本文整理匯總了Java中com.yammer.metrics.stats.Snapshot.getMedian方法的典型用法代碼示例。如果您正苦於以下問題:Java Snapshot.getMedian方法的具體用法?Java Snapshot.getMedian怎麽用?Java Snapshot.getMedian使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.yammer.metrics.stats.Snapshot
的用法示例。
在下文中一共展示了Snapshot.getMedian方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: send
import com.yammer.metrics.stats.Snapshot; //導入方法依賴的package包/類
protected void send(Sampling metric) {
final Snapshot snapshot = metric.getSnapshot();
double[] values = {snapshot.getMedian(), snapshot.get75thPercentile(), snapshot.get95thPercentile(),
snapshot.get98thPercentile(), snapshot.get99thPercentile(), snapshot.get999thPercentile()};
for (int i = 0; i < values.length; ++i) {
sendDouble(SamplingDims[i], values[i]);
}
}
示例2: getNumber
import com.yammer.metrics.stats.Snapshot; //導入方法依賴的package包/類
public Number getNumber(final Metric metric, final Snapshot snapshot) {
if (metric instanceof Histogram) {
Histogram histogram = (Histogram) metric;
switch(this) {
case COUNT:
return histogram.count();
case MAX:
return histogram.max();
case MIN:
return histogram.min();
case MEAN:
return histogram.mean();
case SUM:
return histogram.sum();
case STD_DEV:
return histogram.stdDev();
case MEDIAN:
return snapshot.getMedian();
case PERCENTILE75:
return snapshot.get75thPercentile();
case PERCENTILE95:
return snapshot.get95thPercentile();
case PERCENTILE98:
return snapshot.get98thPercentile();
case PERCENTILE99:
return snapshot.get99thPercentile();
case PERCENTILE999:
return snapshot.get999thPercentile();
default:
throw new RuntimeException("Unexpected property");
}
} else {
throw new IllegalArgumentException("Invalid metric for property");
}
}
示例3: Data
import com.yammer.metrics.stats.Snapshot; //導入方法依賴的package包/類
public Data(Histogram metric) {
Snapshot snapshot = metric.getSnapshot();
this.median = snapshot.getMedian();
this.min = metric.min();
this.max = metric.max();
}