Flavio Castro
Committed by Ray Milkey

Added unit info to metrics CLI command

Change-Id: I1c89b1e684ca86248a5c8a87a625273c2d5dc291
...@@ -16,17 +16,6 @@ ...@@ -16,17 +16,6 @@
16 16
17 package org.onosproject.cli; 17 package org.onosproject.cli;
18 18
19 -import static java.lang.String.format;
20 -
21 -import java.util.Comparator;
22 -import java.util.Map;
23 -import java.util.Map.Entry;
24 -
25 -import org.apache.karaf.shell.commands.Argument;
26 -import org.apache.karaf.shell.commands.Command;
27 -import org.joda.time.LocalDateTime;
28 -import org.onlab.metrics.MetricsService;
29 -
30 import com.codahale.metrics.Counter; 19 import com.codahale.metrics.Counter;
31 import com.codahale.metrics.Gauge; 20 import com.codahale.metrics.Gauge;
32 import com.codahale.metrics.Histogram; 21 import com.codahale.metrics.Histogram;
...@@ -38,6 +27,16 @@ import com.codahale.metrics.Timer; ...@@ -38,6 +27,16 @@ import com.codahale.metrics.Timer;
38 import com.google.common.base.Strings; 27 import com.google.common.base.Strings;
39 import com.google.common.collect.Ordering; 28 import com.google.common.collect.Ordering;
40 import com.google.common.collect.TreeMultimap; 29 import com.google.common.collect.TreeMultimap;
30 +import org.apache.karaf.shell.commands.Argument;
31 +import org.apache.karaf.shell.commands.Command;
32 +import org.joda.time.LocalDateTime;
33 +import org.onlab.metrics.MetricsService;
34 +
35 +import java.util.Comparator;
36 +import java.util.Map;
37 +import java.util.Map.Entry;
38 +
39 +import static java.lang.String.format;
41 40
42 /** 41 /**
43 * Prints metrics in the system. 42 * Prints metrics in the system.
...@@ -118,10 +117,10 @@ public class MetricsListCommand extends AbstractShellCommand { ...@@ -118,10 +117,10 @@ public class MetricsListCommand extends AbstractShellCommand {
118 final Timer timer = (Timer) metric; 117 final Timer timer = (Timer) metric;
119 final Snapshot snapshot = timer.getSnapshot(); 118 final Snapshot snapshot = timer.getSnapshot();
120 print(" count = %d", timer.getCount()); 119 print(" count = %d", timer.getCount());
121 - print(" mean rate = %f", timer.getMeanRate()); 120 + print(" mean rate = %f per second", timer.getMeanRate());
122 - print(" 1-minute rate = %f", timer.getOneMinuteRate()); 121 + print(" 1-minute rate = %f per second", timer.getOneMinuteRate());
123 - print(" 5-minute rate = %f", timer.getFiveMinuteRate()); 122 + print(" 5-minute rate = %f per second", timer.getFiveMinuteRate());
124 - print(" 15-minute rate = %f", timer.getFifteenMinuteRate()); 123 + print(" 15-minute rate = %f per second", timer.getFifteenMinuteRate());
125 print(" min = %f ms", nanoToMs(snapshot.getMin())); 124 print(" min = %f ms", nanoToMs(snapshot.getMin()));
126 print(" max = %f ms", nanoToMs(snapshot.getMax())); 125 print(" max = %f ms", nanoToMs(snapshot.getMax()));
127 print(" mean = %f ms", nanoToMs(snapshot.getMean())); 126 print(" mean = %f ms", nanoToMs(snapshot.getMean()));
......