Skip to content

Commit

Permalink
Merge pull request springside#422 from jenning/master
Browse files Browse the repository at this point in the history
[metrics]fix lastRate & meanRate long/double problem
  • Loading branch information
calvin1978 committed Nov 21, 2014
2 parents 7bf465f + 16bb5da commit 4b20ccd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

public class CounterMetric {
public long totalCount;
public double meanRate;
public long meanRate;
public long lastCount;
public double lastRate;
public long lastRate;

@Override
public String toString() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ private void printGauge(Gauge gauge) {
private void printCounter(CounterMetric counter) {
output.printf(" last count = %d%n", counter.lastCount);
output.printf(" total count = %d%n", counter.totalCount);
output.printf(" last rate = %2.2f/s%n", counter.lastRate);
output.printf(" mean rate = %2.2f/s%n", counter.meanRate);
output.printf(" last rate = %d%n", counter.lastRate);
output.printf(" mean rate = %d%n", counter.meanRate);
}

private void printHistogram(HistogramMetric histogram) {
Expand All @@ -98,8 +98,8 @@ private void printHistogram(HistogramMetric histogram) {

private void printTimer(TimerMetric timer) {
output.printf(" count = %d%n", timer.counterMetric.totalCount);
output.printf(" last rate = %2.2f/s%n", timer.counterMetric.lastRate);
output.printf(" mean rate = %2.2f/s%n", timer.counterMetric.meanRate);
output.printf(" last rate = %d%n", timer.counterMetric.lastRate);
output.printf(" mean rate = %d%n", timer.counterMetric.meanRate);
output.printf(" min = %d ms%n", timer.histogramMetric.min);
output.printf(" max = %d ms%n", timer.histogramMetric.max);
output.printf(" mean = %2.2f ms%n", timer.histogramMetric.mean);
Expand Down

0 comments on commit 4b20ccd

Please sign in to comment.