|
@@ -61,6 +61,8 @@ public class DataNodeMetrics {
|
|
|
@Metric MutableCounterLong bytesRead;
|
|
|
@Metric("Milliseconds spent reading")
|
|
|
MutableCounterLong totalReadTime;
|
|
|
+ @Metric private MutableRate readTransferRate;
|
|
|
+ final private MutableQuantiles[] readTransferRateQuantiles;
|
|
|
@Metric MutableCounterLong blocksWritten;
|
|
|
@Metric MutableCounterLong blocksRead;
|
|
|
@Metric MutableCounterLong blocksReplicated;
|
|
@@ -227,6 +229,7 @@ public class DataNodeMetrics {
|
|
|
sendDataPacketTransferNanosQuantiles = new MutableQuantiles[len];
|
|
|
ramDiskBlocksEvictionWindowMsQuantiles = new MutableQuantiles[len];
|
|
|
ramDiskBlocksLazyPersistWindowMsQuantiles = new MutableQuantiles[len];
|
|
|
+ readTransferRateQuantiles = new MutableQuantiles[len];
|
|
|
|
|
|
for (int i = 0; i < len; i++) {
|
|
|
int interval = intervals[i];
|
|
@@ -255,6 +258,10 @@ public class DataNodeMetrics {
|
|
|
"ramDiskBlocksLazyPersistWindows" + interval + "s",
|
|
|
"Time between the RamDisk block write and disk persist in ms",
|
|
|
"ops", "latency", interval);
|
|
|
+ readTransferRateQuantiles[i] = registry.newQuantiles(
|
|
|
+ "readTransferRate" + interval + "s",
|
|
|
+ "Rate at which bytes are read from datanode calculated in bytes per second",
|
|
|
+ "ops", "rate", interval);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -316,6 +323,13 @@ public class DataNodeMetrics {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public void addReadTransferRate(long readTransferRate) {
|
|
|
+ this.readTransferRate.add(readTransferRate);
|
|
|
+ for (MutableQuantiles q : readTransferRateQuantiles) {
|
|
|
+ q.add(readTransferRate);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public void addCacheReport(long latency) {
|
|
|
cacheReports.add(latency);
|
|
|
}
|