Get the stats from a service.
978794
def get_stats(self, service_id, stat_type=FastlyStatsType.ALL):
		""""""
		content = self._fetch("/service/%s/stats/%s" % (service_id, stat_type))
		return content
955113
def build_stats(counts):
    """"""
    stats = {
        'status': 0,
        'reportnum': counts['reportnum'],
        'title': counts['title'],
        'author': counts['auth_group'],
        'url': counts['url'],
        'doi': counts['doi'],
        'misc': counts['misc'],
    }
    stats_str = "%(status)s-%(reportnum)s-%(title)s-%(author)s-%(url)s-%(doi)s-%(misc)s" % stats
    stats["old_stats_str"] = stats_str
    stats["date"] = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
    stats["version"] = version
    return stats
1167510
public static inat_stats[] get(nitro_service service) throws Exception{
		inat_stats obj = new inat_stats();
		inat_stats[] response = (inat_stats[])obj.stat_resources(service);
		return response;
	}
1317352
def get_stats(self):
        '''
        
        '''
        resp = requests.get('%s/api/stats.json' % self.url)
        assert(resp.status_code == 200)
        return resp.json()
1233636
def get(self):
        
        stats = {}
        if self.start_date is not None:
            stats["start_date"] = self.start_date
        if self.end_date is not None:
            stats["end_date"] = self.end_date
        if self.aggregated_by is not None:
            stats["aggregated_by"] = self.aggregated_by
        if self.sort_by_metric is not None:
            stats["sort_by_metric"] = self.sort_by_metric
        if self.sort_by_direction is not None:
            stats["sort_by_direction"] = self.sort_by_direction
        if self.limit is not None:
            stats["limit"] = self.limit
        if self.offset is not None:
            stats["offset"] = self.offset
        if self.categories is not None:
            stats['categories'] = [category.get() for category in
                                   self.categories]
        return stats
68439
def get_stats(self, request, context):
        """"""
        _log_request(request, context)
        m = self.listener.memory
        return clearly_pb2.StatsMessage(
            task_count=m.task_count,
            event_count=m.event_count,
            len_tasks=len(m.tasks),
            len_workers=len(m.workers)
        )
309620
def __sort_stats(self, sortedby=None):
        """"""
        return sort_stats(self.stats, sortedby,
                          reverse=glances_processes.sort_reverse)
1050729
def get_stats(self):
        
        sent = ctypes.c_uint32()
        recv = ctypes.c_uint32()
        send_errors = ctypes.c_uint32()
        recv_errors = ctypes.c_uint32()
        result = self.library.Par_GetStats(self.pointer, ctypes.byref(sent),
                                   ctypes.byref(recv),
                                   ctypes.byref(send_errors),
                                   ctypes.byref(recv_errors))
        check_error(result, "partner")
        return sent, recv, send_errors, recv_errors
810956
def get_statistics(self):
        
        return {
            'cumulative_elapsed_time': self.get_cumulative_elapsed_time(),
            'percentage': self.get_percentage(),
            'n_splits': self.get_n_splits(),
            'mean_per_split': self.get_mean_per_split(),
        }
575275
def get_current_service_state(self, service_id: str):
        """"""
        state = self._get_service_state(service_id)
        return state.current_state
810574
def stats(self):
        ''''''
        data = Counter()
        for name, value, aggregated in self.raw:
            if aggregated:
                data['%s.max' % name] = max(data['%s.max' % name], value)
                data['%s.total' % name] += value
            else:
                data[name] = value

        return sorted(data.items())
612003
function getStats(results, done) {
  const databases = results.databases;

  const keys = ['document_count', 'storage_size', 'index_count', 'index_size'];
  const stats = {};
  keys.map(function(k) {
    stats[k] = 0;
  });
  databases.map(function(db) {
    keys.map(function(k) {
      stats[k] += db[k];
    });
  });
  done(null, stats);
}
666418
def get_metrics_from_perfdata(self, service, perf_data):
        """"""
        result = []
        metrics = PerfDatas(perf_data)

        for metric in metrics:
            logger.debug("service: %s, metric: %s (%s)", service, metric, metric.__dict__)

            if metric.name in ['time']:
                metric.name = "duration"
            name = sanitize_name(metric.name)
            name = self.multiple_values.sub(r'.\1', name)
            if not name:
                continue

            # get metric value and its thresholds values if they exist
            name_value = {
                name: metric.value,
                'uom_' + name: metric.uom
            }

            # Get or ignore extra values depending upon module configuration
            if metric.warning and self.send_warning:
                name_value[name + '_warn'] = metric.warning

            if metric.critical and self.send_critical:
                name_value[name + '_crit'] = metric.critical

            if metric.min and self.send_min:
                name_value[name + '_min'] = metric.min

            if metric.max and self.send_max:
                name_value[name + '_max'] = metric.max

            for key, value in name_value.items():
                result.append((key, value, metric.uom))

        logger.debug("Metrics: %s - %s", service, result)
        return result
716305
public static Interface_stats[] get(nitro_service service) throws Exception{
		Interface_stats obj = new Interface_stats();
		Interface_stats[] response = (Interface_stats[])obj.stat_resources(service);
		return response;
	}
1302781
def report_stats(self):
        """"""
        if not self.previous:
            self.previous = dict()
            for key in self.counters:
                self.previous[key] = 0
        values = {
            'name': self.name,
            'consumer_name': self.consumer_name,
            'counts': dict(self.counters),
            'previous': dict(self.previous)
        }
        self.previous = dict(self.counters)
        return values
973810
public static dns_stats get(nitro_service service) throws Exception{
		dns_stats obj = new dns_stats();
		dns_stats[] response = (dns_stats[])obj.stat_resources(service);
		return response[0];
	}
3580
def _job_statistics(self):
        """"""
        statistics = self._properties.get("statistics", {})
        return statistics.get(self._JOB_TYPE, {})