}
public Map<String, Gauge<Long>> gauges() {
Map<String, Gauge<Long>> gauges = Maps.newHashMap();
final TrafficCounter tc = this.getTrafficCounter();
gauges.put("read_bytes_1sec", new Gauge<Long>() {
@Override
public Long getValue() {
return tc.getLastReadBytes();
}
});
gauges.put("written_bytes_1sec", new Gauge<Long>() {
@Override
public Long getValue() {
return tc.getLastWrittenBytes();
}
});
gauges.put("read_bytes_total", new Gauge<Long>() {
@Override
public Long getValue() {
return tc.getCumulativeReadBytes();
}
});
gauges.put("written_bytes_total", new Gauge<Long>() {
@Override
public Long getValue() {
return tc.getCumulativeWrittenBytes();
}
});
return gauges;
}