本文整理了Java中com.yammer.metrics.core.Gauge
类的一些代码示例,展示了Gauge
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Gauge
类的具体详情如下:
包路径:com.yammer.metrics.core.Gauge
类名称:Gauge
[英]A gauge metric is an instantaneous reading of a particular value. To instrument a queue's depth, for example:
final Queue<String> queue = new ConcurrentLinkedQueue<String>();
final Gauge<Integer> queueDepth = new Gauge<Integer>() {
public Integer value() {
return queue.size();
}
};
[中]仪表度量是特定值的瞬时读数。要检测队列的深度,例如:
final Queue<String> queue = new ConcurrentLinkedQueue<String>();
final Gauge<Integer> queueDepth = new Gauge<Integer>() {
public Integer value() {
return queue.size();
}
};
代码示例来源:origin: apache/incubator-pinot
public void refresh() {
long sum = 0;
for (Gauge<T> gauge : _gauges) {
sum += gauge.value().longValue();
}
_value = sum / _gauges.size();
}
代码示例来源:origin: linkedin/cruise-control
@Override
public void processGauge(MetricName metricName, Gauge<?> gauge, Context context) {
if (MetricsUtils.isInterested(metricName)) {
LOG.trace("Processing metric {} of type Gauge.", metricName);
if (!(gauge.value() instanceof Number)) {
throw new IllegalStateException(String.format("The value of yammer metric %s is %s, which is not a number",
metricName, gauge.value()));
}
CruiseControlMetric ccm = MetricsUtils.toCruiseControlMetric(context.time(),
context.brokerId(),
metricName,
((Number) gauge.value()).doubleValue());
context.reporter().sendCruiseControlMetric(ccm);
}
}
代码示例来源:origin: apache/incubator-pinot
@Override
public String toString() {
return "NettyClientMetric [_requestsSent=" + _requestsSent.count() + ", _bytesSent=" + _bytesSent.count()
+ ", _bytesReceived=" + _bytesReceived.count() + ", _errors=" + _errors.count() + ", _sendRequestMsGauge="
+ _sendRequestMsHistogram.count() + ", _responseLatencyMsGauge=" + _responseLatencyMsHistogram.count()
+ ", _connectMsGauge=" + _connectMsGauge.value() + "]";
}
代码示例来源:origin: com.yammer.metrics/metrics-core
@Override
public Object getValue() {
return metric.value();
}
}
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server
public Long getValue(ColumnFamilyMetrics metric)
{
return metric.memtableOnHeapSize.value();
}
});
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server
public Long getValue(ColumnFamilyMetrics metric)
{
return (long) metric.pendingCompactions.value();
}
});
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server
/**
* @return the total size occupied by commitlog segments expressed in bytes. (used by MBean)
*/
public long getTotalCommitlogSize()
{
return metrics.totalCommitLogSize.value();
}
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server
public Long getValue(ColumnFamilyMetrics metric)
{
return metric.memtableOffHeapSize.value();
}
});
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server
public Long getValue(ColumnFamilyMetrics metric)
{
return metric.allMemtablesOnHeapSize.value();
}
});
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server
@Override
public long getPendingTasks()
{
return metrics.pendingTasks.value();
}
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server
public Long getValue(ColumnFamilyMetrics metric)
{
return metric.allMemtablesLiveDataSize.value();
}
});
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server
@Override
public long getCompletedTasks()
{
return metrics.completedTasks.value();
}
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server
public Long getValue(ColumnFamilyMetrics metric)
{
return metric.memtableColumnsCount.value();
}
});
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server
public Long getValue(ColumnFamilyMetrics metric)
{
return metric.memtableLiveDataSize.value();
}
});
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server
public Long getValue(ColumnFamilyMetrics metric)
{
return metric.bloomFilterDiskSpaceUsed.value();
}
});
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server
public Long getValue(ColumnFamilyMetrics metric)
{
return metric.bloomFilterOffHeapMemoryUsed.value();
}
});
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server
public Long getValue(ColumnFamilyMetrics metric)
{
return metric.allMemtablesOffHeapSize.value();
}
});
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server
public Long getValue(ColumnFamilyMetrics metric)
{
return metric.indexSummaryOffHeapMemoryUsed.value();
}
});
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server
public Long getValue(ColumnFamilyMetrics metric)
{
return metric.compressionMetadataOffHeapMemoryUsed.value();
}
});
代码示例来源:origin: com.facebook.presto.cassandra/cassandra-server
public double getCompressionRatio()
{
return metric.compressionRatio.value();
}
内容来源于网络,如有侵权,请联系作者删除!