From 3928b1e47f9d2cea502f4884379b3ba664e92d7e Mon Sep 17 00:00:00 2001 From: MATSUU Takuto Date: Wed, 13 Sep 2017 18:01:47 +0900 Subject: [PATCH] fix a formula --- src/go/mongolib/stats/stats.go | 2 +- src/go/tests/profiler_docs_stats.want.json | 6 +++--- src/go/tests/profiler_docs_total_stats.want.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/go/mongolib/stats/stats.go b/src/go/mongolib/stats/stats.go index 9123d79e..2f84147e 100644 --- a/src/go/mongolib/stats/stats.go +++ b/src/go/mongolib/stats/stats.go @@ -281,7 +281,7 @@ func countersToStats(query QueryInfoAndCounters, uptime int64, tc totalCounters) queryStats.QueryTime.Pct = queryStats.QueryTime.Total * 100 / tc.QueryTime } if tc.Bytes > 0 { - queryStats.ResponseLength.Pct = queryStats.ResponseLength.Total / tc.Bytes + queryStats.ResponseLength.Pct = queryStats.ResponseLength.Total * 100 / tc.Bytes } if queryStats.Returned.Total > 0 { queryStats.Ratio = queryStats.Scanned.Total / queryStats.Returned.Total diff --git a/src/go/tests/profiler_docs_stats.want.json b/src/go/tests/profiler_docs_stats.want.json index fc203be0..3c0e01df 100644 --- a/src/go/tests/profiler_docs_stats.want.json +++ b/src/go/tests/profiler_docs_stats.want.json @@ -22,7 +22,7 @@ "Median": 0 }, "ResponseLength": { - "Pct": 0.9995949739087844, + "Pct": 99.95949739087844, "Total": 1061230, "Min": 1061230, "Max": 1061230, @@ -75,7 +75,7 @@ "Median": 7 }, "ResponseLength": { - "Pct": 0.00020251304560782172, + "Pct": 0.020251304560782172, "Total": 215, "Min": 215, "Max": 215, @@ -128,7 +128,7 @@ "Median": 0 }, "ResponseLength": { - "Pct": 0.00020251304560782172, + "Pct": 0.020251304560782172, "Total": 215, "Min": 215, "Max": 215, diff --git a/src/go/tests/profiler_docs_total_stats.want.json b/src/go/tests/profiler_docs_total_stats.want.json index 39bc4c5c..7bcdfeb0 100755 --- a/src/go/tests/profiler_docs_total_stats.want.json +++ b/src/go/tests/profiler_docs_total_stats.want.json @@ -21,7 +21,7 @@ "Median": 0 }, "ResponseLength": { - "Pct": 1, + "Pct": 100, "Total": 1061660, "Min": 215, "Max": 1061230,