/ Get Stats using the older API. Used by all current versions of Chrome.
8732
function parseStatsOldAPI (peerConnection,
                                                      prevStats,
                                                      currentStats,
                                                      completion) {

      /* this parses a result if there it contains the video bitrate */
      var parseVideoStats = function (result) {
            if (result.stat('googFrameRateSent')) {
              currentStats.videoSentBytes = Number(result.stat('bytesSent'));
              currentStats.videoSentPackets = Number(result.stat('packetsSent'));
              currentStats.videoSentPacketsLost = Number(result.stat('packetsLost'));
              currentStats.videoRtt = Number(result.stat('googRtt'));
              currentStats.videoFrameRate = Number(result.stat('googFrameRateInput'));
              currentStats.videoWidth = Number(result.stat('googFrameWidthSent'));
              currentStats.videoHeight = Number(result.stat('googFrameHeightSent'));
              currentStats.videoCodec = result.stat('googCodecName');
            } else if (result.stat('googFrameRateReceived')) {
              currentStats.videoRecvBytes = Number(result.stat('bytesReceived'));
              currentStats.videoRecvPackets = Number(result.stat('packetsReceived'));
              currentStats.videoRecvPacketsLost = Number(result.stat('packetsLost'));
              currentStats.videoFrameRate = Number(result.stat('googFrameRateOutput'));
              currentStats.videoWidth = Number(result.stat('googFrameWidthReceived'));
              currentStats.videoHeight = Number(result.stat('googFrameHeightReceived'));
              currentStats.videoCodec = result.stat('googCodecName');
            }
            return null;
          },

          parseAudioStats = function (result) {
            if (result.stat('audioInputLevel')) {
              currentStats.audioSentPackets = Number(result.stat('packetsSent'));
              currentStats.audioSentPacketsLost = Number(result.stat('packetsLost'));
              currentStats.audioSentBytes =  Number(result.stat('bytesSent'));
              currentStats.audioCodec = result.stat('googCodecName');
              currentStats.audioRtt = Number(result.stat('googRtt'));
            } else if (result.stat('audioOutputLevel')) {
              currentStats.audioRecvPackets = Number(result.stat('packetsReceived'));
              currentStats.audioRecvPacketsLost = Number(result.stat('packetsLost'));
              currentStats.audioRecvBytes =  Number(result.stat('bytesReceived'));
              currentStats.audioCodec = result.stat('googCodecName');
            }
          },

          parseStatsReports = function (stats) {
            if (stats.result) {
              var resultList = stats.result();
              for (var resultIndex = 0; resultIndex < resultList.length; resultIndex++) {
                var result = resultList[resultIndex];

                if (result.stat) {

                  if(result.stat('googActiveConnection') === 'true') {
                    currentStats.localCandidateType = result.stat('googLocalCandidateType');
                    currentStats.remoteCandidateType = result.stat('googRemoteCandidateType');
                    currentStats.transportType = result.stat('googTransportType');
                  }

                  parseAudioStats(result);
                  parseVideoStats(result);
                }
              }
            }

            completion(null, currentStats);
          };

      peerConnection.getStats(parseStatsReports);
    }
879529
public static appfw_stats get(nitro_service service) throws Exception{
		appfw_stats obj = new appfw_stats();
		appfw_stats[] response = (appfw_stats[])obj.stat_resources(service);
		return response[0];
	}
79337
public static cachepolicylabel_stats[] get(nitro_service service) throws Exception{
		cachepolicylabel_stats obj = new cachepolicylabel_stats();
		cachepolicylabel_stats[] response = (cachepolicylabel_stats[])obj.stat_resources(service);
		return response;
	}
321582
def stats(self):
        
        response = self.requester.get(
            '/{endpoint}/{id}/stats',
            endpoint=self.endpoint, id=self.id
        )
        return response.json()
250521
def get_stats(self, queue):
        
        uri = "/%s/%s/stats" % (self.uri_base, utils.get_id(queue))
        resp, resp_body = self.api.method_get(uri)
        return resp_body.get("messages")
1005121
public static ssl_stats get(nitro_service service) throws Exception{
		ssl_stats obj = new ssl_stats();
		ssl_stats[] response = (ssl_stats[])obj.stat_resources(service);
		return response[0];
	}
1110106
def _get_cached_stats(self, app_stats):
        
        stats = {}
        app_keys = [
            "cached_host_check_stats",
            "cached_service_check_stats",
        ]
        for app_key in app_keys:
            if app_key not in app_stats.keys():
                continue

            (x01, x05, x15) = self._convert_tripplet(app_stats[app_key])
            scratch = app_key.split("_")[1]
            stats["%ss.cached.01" % (scratch)] = x01
            stats["%ss.cached.05" % (scratch)] = x05
            stats["%ss.cached.15" % (scratch)] = x15

        return stats
1087322
def _api_all(self):
        
        response.content_type = 'application/json; charset=utf-8'

        if self.args.debug:
            fname = os.path.join(tempfile.gettempdir(), 'glances-debug.json')
            try:
                with open(fname) as f:
                    return f.read()
            except IOError:
                logger.debug("Debug file (%s) not found" % fname)

        # Update the stat
        self.__update__()

        try:
            # Get the JSON value of the stat ID
            statval = json.dumps(self.stats.getAllAsDict())
        except Exception as e:
            abort(404, "Cannot get stats (%s)" % str(e))

        return statval
307077
func GetStats() (stats Stats, err error) {
	var memInfo memoryStatusEx
	memInfo.cbSize = uint32(unsafe.Sizeof(memInfo))
	if mem, _, _ := procGlobalMemoryStatusEx.Call(uintptr(unsafe.Pointer(&memInfo))); mem == 0 {
		err = syscall.GetLastError()
	} else {
		stats.TotalRAM = memInfo.ullTotalPhys
	}

	return stats, err
}
1368783
def stats_send(template = nil, start_date = nil, end_date = nil, options = {})
      data = options
      if template != nil
        data[:template] = template
      end
      if start_date != nil
        data[:start_date] = start_date
      end
      if end_date != nil
        data[:end_date] = end_date
      end
      data[:stat] = 'send'
      api_get(:stats, data)
    end
352147
function statRecord(url){
        if(typeof url === "string") {
            var sep = url.indexOf('?') === -1 ? "/?" : "&";
            url = url + sep + "pagecache=1";
            ajax(url,function(res){
                //console.log("%ccache stat","color:red");
            });
        }
    }
144490
func GetStats() (stats Stats, err error) {
	var limit uint64
	limit, err = getMemoryLimit()
	if err != nil {
		return Stats{}, err
	}

	stats.TotalRAM = limit
	return stats, nil
}
1142335
public com.google.api.ads.admanager.axis.v201805.Stats getStats() {
        return stats;
    }
123205
function(params, headers, callback) {
        var url;
        url = this.client.url(false);
        return this.client.get(url, params, headers, callback);
      }
12155
func Get(data []int) Stats {
	if len(data) == 0 {
		return Stats{}
	}
	min, max := minmax(data)

	return Stats{
		Avg: avg(data) / msFactor,
		Min: min / msFactor,
		Max: max / msFactor,
		P50: p(data, 0.5) / msFactor,
		P75: p(data, 0.75) / msFactor,
		P90: p(data, 0.9) / msFactor,
		P95: p(data, 0.95) / msFactor,
		P99: p(data, 0.99) / msFactor,
	}
}
196337
func RequestStats() gin.HandlerFunc {
	return func(c *gin.Context) {
		start := time.Now()

		c.Next()

		req := metrics.GetOrRegisterMeter(ginRequestMetric, nil)
		req.Mark(1)

		latency := metrics.GetOrRegisterTimer(ginLatencyMetric, nil)
		latency.UpdateSince(start)

		status := metrics.GetOrRegisterMeter(fmt.Sprintf("%s.%d", ginStatusMetric, c.Writer.Status()), nil)
		status.Mark(1)
	}
}
472602
func (bs *benchmarkServer) getStats(reset bool) *testpb.ServerStats {
	bs.mu.RLock()
	defer bs.mu.RUnlock()
	wallTimeElapsed := time.Since(bs.lastResetTime).Seconds()
	rusageLatest := syscall.GetRusage()
	uTimeElapsed, sTimeElapsed := syscall.CPUTimeDiff(bs.rusageLastReset, rusageLatest)

	if reset {
		bs.lastResetTime = time.Now()
		bs.rusageLastReset = rusageLatest
	}
	return &testpb.ServerStats{
		TimeElapsed: wallTimeElapsed,
		TimeUser:    uTimeElapsed,
		TimeSystem:  sTimeElapsed,
	}
}