public class ServiceMetricCollectorSupport extends ServiceMetricCollector
RequestMetricCollector
ServiceMetricCollector.Factory
Modifier and Type | Field and Description |
---|---|
protected static org.apache.commons.logging.Log |
log |
(package private) static double |
NANO_PER_SEC |
private java.util.concurrent.BlockingQueue<MetricDatum> |
queue |
NONE
Modifier | Constructor and Description |
---|---|
protected |
ServiceMetricCollectorSupport(java.util.concurrent.BlockingQueue<MetricDatum> queue) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
addMetricsToQueue(MetricDatum metric)
Adds the given metric to the queue, returning true if successful or false
if no space available.
|
(package private) double |
bytesPerSecond(double byteCount,
double durationNano)
Returns the number of bytes per second, given the byte count and
duration in nano seconds.
|
void |
collectByteThroughput(ByteThroughputProvider provider)
Collects metrics on the number of bytes written or read and the respective
duration.
|
private void |
collectByteThroughput0(ByteThroughputProvider provider) |
void |
collectLatency(ServiceLatencyProvider provider)
Collects metrics for non-request specific latencies.
|
private void |
safeAddMetricsToQueue(MetricDatum metric) |
isEnabled
static final double NANO_PER_SEC
protected static final org.apache.commons.logging.Log log
private final java.util.concurrent.BlockingQueue<MetricDatum> queue
protected ServiceMetricCollectorSupport(java.util.concurrent.BlockingQueue<MetricDatum> queue)
public void collectByteThroughput(ByteThroughputProvider provider)
ServiceMetricCollector
collectByteThroughput
in class ServiceMetricCollector
double bytesPerSecond(double byteCount, double durationNano)
private void collectByteThroughput0(ByteThroughputProvider provider)
public void collectLatency(ServiceLatencyProvider provider)
ServiceMetricCollector
collectLatency
in class ServiceMetricCollector
private void safeAddMetricsToQueue(MetricDatum metric)
protected boolean addMetricsToQueue(MetricDatum metric)