From 0bc9ad0628ed96400ae9d0196b3453bfdc48c5b8 Mon Sep 17 00:00:00 2001 From: Andrew Purtell Date: Thu, 9 Mar 2017 16:54:23 -0800 Subject: [PATCH] HBASE-17731 Fractional latency reporting in MultiThreadedAction --- .../org/apache/hadoop/hbase/util/MultiThreadedAction.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/MultiThreadedAction.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/MultiThreadedAction.java index 2304732d34a..c5487a13996 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/util/MultiThreadedAction.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/util/MultiThreadedAction.java @@ -219,11 +219,13 @@ public abstract class MultiThreadedAction { + ", time=" + formatTime(time) + ((numKeys > 0 && time > 0) ? (" Overall: [" + "keys/s= " - + numKeys * 1000 / time + ", latency=" + totalOpTime - / numKeys + " ms]") : "") + + numKeys * 1000 / time + ", latency=" + + String.format("%.2f", (double)totalOpTime / (double)numKeys) + + " ms]") : "") + ((numKeysDelta > 0) ? (" Current: [" + "keys/s=" + numKeysDelta * 1000 / REPORTING_INTERVAL_MS + ", latency=" - + totalOpTimeDelta / numKeysDelta + " ms]") : "") + + String.format("%.2f", (double)totalOpTimeDelta / (double)numKeysDelta) + + " ms]") : "") + progressInfo()); if (streamingCounters) {