Format a list of statistics
@param stats The statistics list to format
@return A ChannelBuffer object to pass on to the caller
@throws BadRequestException if the plugin has not implemented this method
325039
public ChannelBuffer formatStatsV1(final List<IncomingDataPoint> stats) {
    throw new BadRequestException(HttpResponseStatus.NOT_IMPLEMENTED, 
        "The requested API endpoint has not been implemented", 
        this.getClass().getCanonicalName() + 
        " has not implemented formatStatsV1");
  }
656592
protected static List<String> formatMessageParameters(Object[] parameters) {
        List<String> arguments = new ArrayList<>(parameters.length);
        for (Object argument : parameters) {
            arguments.add((argument != null) ? argument.toString() : null);
        }
        return arguments;
    }
279501
public String getStatistics() {
        StringBuilder sb = new StringBuilder();
        
        for(String key : stats.keySet()) {
            sb.append(key);
            sb.append(": ");
            sb.append(stats.get(key));
            sb.append("\n");
        }
        
        return sb.toString();
    }
590527
public static rewritepolicylabel_stats[] get(nitro_service service) throws Exception{
		rewritepolicylabel_stats obj = new rewritepolicylabel_stats();
		rewritepolicylabel_stats[] response = (rewritepolicylabel_stats[])obj.stat_resources(service);
		return response;
	}
838260
public StatisticImpl[] getJ2EEStatistics() {
        ArrayList members = copyStatistics();
        if (members == null || members.size() == 0)
            return new StatisticImpl[0];

        StatisticImpl[] ret = new StatisticImpl[members.size()];
        for (int i = 0; i < ret.length; i++) {
            ret[i] = (StatisticImpl) members.get(i);
        }
        return ret;
    }
890838
public void setStatistics(java.util.Collection<String> statistics) {
        if (statistics == null) {
            this.statistics = null;
            return;
        }

        this.statistics = new java.util.ArrayList<String>(statistics);
    }
919591
public synchronized void printStatistics() {
        ClientStats stats = m_periodicStatsContext.fetchAndResetBaseline().getStats();
        long time = Math.round((stats.getEndTimestamp() - m_startTS) / 1000.0);

        StringBuilder statsBuilder = new StringBuilder();
        statsBuilder.append(String.format("%02d:%02d:%02d ", time / 3600, (time / 60) % 60, time % 60));
        statsBuilder.append(String.format("Throughput %d/s, ", stats.getTxnThroughput()));
        statsBuilder.append(String.format("Aborts/Failures %d/%d",
                stats.getInvocationAborts(), stats.getInvocationErrors()));

        if (m_config.latencyreport) {
            statsBuilder.append(String.format(", Avg/95%% Latency %.2f/%.2fms",
                                stats.getAverageLatency(),
                                stats.kPercentileLatencyAsDouble(0.95)));
        }
        printLog(statsBuilder.toString());
    }
378909
public StatisticImpl getStatistic() {
        if (enabled) {
            if (proxy == null) {
                System.out.println("[SpdStatisticExternal] null proxy");
                return null;
            }

            proxy.updateStatisticOnRequest(dataId);

            // onReqStatistic will be updated by the component
            // the reference is kept in this class
            return onReqStatistic;
        } else
            return null;
    }
966150
public ListStreamStatisticsResponse listStreamStatistics(ListStreamStatisticsRequest request) {
        checkNotNull(request, "The parameter request should NOT be null.");

        checkStringNotEmpty(request.getDomain(), "Domain should NOT be null");
        checkStringNotEmpty(request.getApp(), "App should NOT be null");
        checkStringNotEmpty(request.getStartTime(), "StartTime should NOT be null");

        InternalRequest internalRequest = createRequest(HttpMethodName.GET, request,
                STATISTICS, LIVE_DOMAIN, request.getDomain(), LIVE_STREAM);

        internalRequest.addParameter("app", request.getApp());
        internalRequest.addParameter("startTime", request.getStartTime());
        if (request.getEndTime() != null) {
            internalRequest.addParameter("endTime", request.getEndTime());
        }
        if (request.getKeyword() != null) {
            internalRequest.addParameter("keyword", request.getKeyword());
        }
        if (request.getKeywordType() != null) {
            internalRequest.addParameter("keywordType", request.getKeywordType());
        }
        if (request.getOrderBy() != null) {
            internalRequest.addParameter("orderBy", request.getOrderBy());
        }
        if (request.getPageNo() != null) {
            internalRequest.addParameter("pageNo", request.getPageNo().toString());
        }
        if (request.getPageSize() != null) {
            internalRequest.addParameter("pageSize", request.getPageSize().toString());
        }
        return invokeHttpClient(internalRequest, ListStreamStatisticsResponse.class);
    }
887437
public static String getAllStats(OutputFormat format) {
		StringBuilder sb = new StringBuilder();
		boolean first = true;
		
		Collection<PerfStatEntry> stats = perfStats.get().values();
		
		switch (format) {
		case JSON:
			sb.append('{');
			for (PerfStatEntry entry : stats) {
				if (entry.count > 0) {
					if (first) {
						first = false;
					} else {
						sb.append(',');
					}
					sb.append('"').append(entry.name).append("\":");
					if (entry.isErr)
						sb.append("null");
					else
						sb.append(entry.total);
				}
			}
			sb.append('}');
			break;
		default:
			sb.append("[");
			for (PerfStatEntry entry : stats) {
				if (entry.count > 0) {
					if (first) {
						first = false;
					} else {
						sb.append(", ");
					}
					sb.append(entry.toString());
				}
			}			
			sb.append("]");
			break;
		}
		return sb.toString();
	}
931591
public static lbvserver_stats[] get(nitro_service service) throws Exception{
		lbvserver_stats obj = new lbvserver_stats();
		lbvserver_stats[] response = (lbvserver_stats[])obj.stat_resources(service);
		return response;
	}
927355
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);
          }
263870
public static String statsToTclAttrString(StatsImpl stats, DataDescriptor dd, String nodeName, String serverName) {
        return statsToTclAttrString(null, stats, dd, nodeName, serverName);
    }
1215348
public List<QueryStats> getReportSortedBy(String sortByVal) {
        SortBy sortBy;
        try {
            sortBy = SortBy.valueOf(sortByVal);
        } catch (Exception e) {
            throw new IllegalArgumentException("allowed values are: " + Arrays.toString(SortBy.values()));
        }

        List<QueryStats> res = new ArrayList<>(statsByQuery.values());
        Collections.sort(res, sortBy.getComparator());
        return res;
    }
329412
public void setChannelSummaries(java.util.Collection<ChannelSummary> channelSummaries) {
        if (channelSummaries == null) {
            this.channelSummaries = null;
            return;
        }

        this.channelSummaries = new java.util.ArrayList<ChannelSummary>(channelSummaries);
    }
1314420
def display_stats(request, stats, queries):
    
    sort = [
        request.REQUEST.get('sort_first', 'time'),
        request.REQUEST.get('sort_second', 'calls')
    ]
    fmt = request.REQUEST.get('format', 'print_stats')
    sort_first_buttons = RadioButtons('sort_first', sort[0], sort_categories)
    sort_second_buttons = RadioButtons('sort_second', sort[1], sort_categories)
    format_buttons = RadioButtons('format', fmt, (
        ('print_stats', 'by function'),
        ('print_callers', 'by callers'),
        ('print_callees', 'by callees')
    ))
    output = render_stats(stats, sort, fmt)
    output.reset()
    output = [html.escape(unicode(line)) for line in output.readlines()]
    response = HttpResponse(content_type='text/html; charset=utf-8')
    response.content = (stats_template % {
        'format_buttons': format_buttons,
        'sort_first_buttons': sort_first_buttons,
        'sort_second_buttons': sort_second_buttons,
        'rawqueries' : b64encode(cPickle.dumps(queries)),
        'rawstats': b64encode(pickle_stats(stats)),
        'stats': "".join(output),
        'url': request.path
    })
    return response
246588
function(stats) {
      var map = new Map();
      Object.keys(stats).forEach(function(key) {
        map.set(key, stats[key]);
        map[key] = stats[key];
      });
      return map;
    }