Repository: asterixdb Updated Branches: refs/heads/master 40b2808ea -> 45d4f6c94
Report integer metrics as numbers Change-Id: Ie330ba0e030d188adbf675741c382cf2754853f1 Reviewed-on: https://asterix-gerrit.ics.uci.edu/1496 Sonar-Qube: Jenkins <jenk...@fulliautomatix.ics.uci.edu> Tested-by: Jenkins <jenk...@fulliautomatix.ics.uci.edu> Integration-Tests: Jenkins <jenk...@fulliautomatix.ics.uci.edu> Reviewed-by: Ian Maxon <ima...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/45d4f6c9 Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/45d4f6c9 Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/45d4f6c9 Branch: refs/heads/master Commit: 45d4f6c948c6071fc22d94c4b8f00d62947e7b33 Parents: 40b2808 Author: Till Westmann <ti...@apache.org> Authored: Fri Feb 10 10:59:47 2017 -0800 Committer: Till Westmann <ti...@apache.org> Committed: Mon Feb 13 14:03:39 2017 -0800 ---------------------------------------------------------------------- .../asterix/api/http/server/QueryServiceServlet.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/asterixdb/blob/45d4f6c9/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/QueryServiceServlet.java ---------------------------------------------------------------------- diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/QueryServiceServlet.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/QueryServiceServlet.java index 744b929..7cb492b 100644 --- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/QueryServiceServlet.java +++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/QueryServiceServlet.java @@ -337,11 +337,18 @@ public class QueryServiceServlet extends AbstractServlet { } private static void printField(PrintWriter pw, String name, String value, boolean comma) { + printFieldInternal(pw, name, "\"" + value + "\"", comma); + } + + private static void printField(PrintWriter pw, String name, long value, boolean comma) { + printFieldInternal(pw, name, String.valueOf(value), comma); + } + + private static void printFieldInternal(PrintWriter pw, String name, String value, boolean comma) { pw.print("\t\""); pw.print(name); - pw.print("\": \""); + pw.print("\": "); pw.print(value); - pw.print('"'); if (comma) { pw.print(','); } @@ -409,9 +416,9 @@ public class QueryServiceServlet extends AbstractServlet { pw.print("\t"); printField(pw, Metrics.EXECUTION_TIME.str(), TimeUnit.formatNanos(executionTime)); pw.print("\t"); - printField(pw, Metrics.RESULT_COUNT.str(), String.valueOf(resultCount)); + printField(pw, Metrics.RESULT_COUNT.str(), resultCount, true); pw.print("\t"); - printField(pw, Metrics.RESULT_SIZE.str(), String.valueOf(resultSize), false); + printField(pw, Metrics.RESULT_SIZE.str(), resultSize, false); pw.print("\t}\n"); }