}
private void registerMetrics(Metrics metrics) {
metrics.addMetric("waiting-threads",
"The number of user threads blocked waiting for buffer memory to enqueue their records",
new Measurable() {
public double measure(MetricConfig config, long now) {
return free.queued();
}
});
metrics.addMetric("buffer-total-bytes",
"The maximum amount of buffer memory the client can use (whether or not it is currently used).",
new Measurable() {
public double measure(MetricConfig config, long now) {
return free.totalMemory();
}
});
metrics.addMetric("buffer-available-bytes",
"The total amount of buffer memory that is not being used (either unallocated or in the free list).",
new Measurable() {
public double measure(MetricConfig config, long now) {
return free.availableMemory();
}
});
}