* Metrics related to DFS capacity are stored in bytes which do not fit in
* int, so they are rounded to GB
*/
public void doUpdates(MetricsContext unused) {
synchronized (this) {
FSNamesystem fsNameSystem = FSNamesystem.getFSNamesystem();
filesTotal.set((int)fsNameSystem.getFilesTotal());
filesTotal.pushMetric(metricsRecord);
blocksTotal.set((int)fsNameSystem.getBlocksTotal());
blocksTotal.pushMetric(metricsRecord);
capacityTotalGB.set(roundBytesToGBytes(fsNameSystem.getCapacityTotal()));
capacityTotalGB.pushMetric(metricsRecord);
capacityUsedGB.set(roundBytesToGBytes(fsNameSystem.getCapacityUsed()));
capacityUsedGB.pushMetric(metricsRecord);
capacityRemainingGB.set(roundBytesToGBytes(fsNameSystem.
getCapacityRemaining()));
capacityRemainingGB.pushMetric(metricsRecord);
totalLoad.set(fsNameSystem.getTotalLoad());
totalLoad.pushMetric(metricsRecord);
pendingReplicationBlocks.set((int)fsNameSystem.
getPendingReplicationBlocks());
pendingReplicationBlocks.pushMetric(metricsRecord);
underReplicatedBlocks.set((int)fsNameSystem.getUnderReplicatedBlocks());
underReplicatedBlocks.pushMetric(metricsRecord);
scheduledReplicationBlocks.set((int)fsNameSystem.
getScheduledReplicationBlocks());
scheduledReplicationBlocks.pushMetric(metricsRecord);
}
metricsRecord.update();
}