def getStats(self,exp_uid,args_json,db,ell):
    """
    Get statistics for the experiment and its algorithms

    Expected input (in json structure with string keys):
      (string) stat_id : identifier for the desired statistic
      (dict) params : dictionary of stat_id specific fields.

    See Next.utils.get_app_supported_stats(app_id) ResourceManager.get_app_supported_stats(app_id)
    for a description of each of the available stats and their inputs and outputs
    """

    try:
      app_id = self.app_id

      log_entry = { 'exp_uid':exp_uid,'task':'getStats','json':args_json,'timestamp':utils.datetimeNow() } 
      ell.log( app_id+':APP-CALL', log_entry  )

      # convert args_json to args_dict
      try:
        args_dict = json.loads(args_json)
      except:
        error = "%s.getStats input args_json is in improper format" % self.app_id
        return '{}',False,error

      # check for the fields that must be contained in args or error occurs
      necessary_fields = ['stat_id','params']
      for field in necessary_fields:
        try:
          args_dict[field]
        except KeyError:
          error = "%s.getStats input arguments missing field: %s" % (self.app_id,str(field)) 
          return '{}',False,error

      stat_id = args_dict['stat_id']
      params = args_dict['params']

      dashboard = CardinalBanditsPureExplorationDashboard(db,ell)

      # input task
      if stat_id == "api_activity_histogram":
        task = params['task']
        activity_stats = dashboard.api_activity_histogram(self.app_id,exp_uid,task)
        stats = activity_stats

      # input Noneokay
      elif stat_id == "api_processAnswer_activity_stacked_histogram":
        activity_stats = dashboard.api_processAnswer_activity_stacked_histogram(self.app_id,exp_uid)
        stats = activity_stats

      # input task
      elif stat_id == "compute_duration_multiline_plot":
        task = params['task']
        compute_stats = dashboard.compute_duration_multiline_plot(self.app_id,exp_uid,task)
        stats = compute_stats

      # input task, alg_label
      elif stat_id == "compute_duration_detailed_stacked_area_plot":
        task = params['task']
        alg_label = params['alg_label']
        compute_detailed_stats = dashboard.compute_duration_detailed_stacked_area_plot(self.app_id,exp_uid,task,alg_label)
        stats = compute_detailed_stats

      # input alg_label
      elif stat_id == "response_time_histogram":
        alg_label = params['alg_label']
        response_time_stats = dashboard.response_time_histogram(self.app_id,exp_uid,alg_label)
        stats = response_time_stats
        
      # input alg_label
      elif stat_id == "network_delay_histogram":
        alg_label = params['alg_label']
        network_delay_stats = dashboard.network_delay_histogram(self.app_id,exp_uid,alg_label)
        stats = network_delay_stats

      # input alg_label
      elif stat_id == "most_current_ranking":
        alg_label = params['alg_label']
        stats = dashboard.most_current_ranking(self.app_id,exp_uid,alg_label)

      response_json = json.dumps(stats)

      log_entry = { 'exp_uid':exp_uid,'task':'getStats','json':response_json,'timestamp':utils.datetimeNow() } 
      ell.log( app_id+':APP-RESPONSE', log_entry  )

      return response_json,True,''
    except Exception, err:
      error = traceback.format_exc()
      log_entry = { 'exp_uid':exp_uid,'task':'getStats','error':error,'timestamp':utils.datetimeNow(),'args_json':args_json } 
      ell.log( app_id+':APP-EXCEPTION', log_entry  )
      return '{}',False,error
dataset/ETHPy150Open nextml/NEXT/next/apps/CardinalBanditsPureExploration/CardinalBanditsPureExploration.py/CardinalBanditsPureExploration.getStats/original