From 831b84ab2ed43c60614aa82269c28d0cf372dd59 Mon Sep 17 00:00:00 2001 From: Jan Steemann Date: Thu, 14 Feb 2013 15:19:08 +0100 Subject: [PATCH] fixed issue #348 --- CHANGELOG | 3 +++ Documentation/Examples/request-statistics | 5 ++++ .../Examples/request-statistics-current | 7 +++++- .../RestHandler/ConnectionStatisticsHandler.h | 4 ---- .../RestHandler/RequestStatisticsHandler.h | 3 +++ lib/Statistics/statistics.cpp | 24 +++++++++---------- 6 files changed, 29 insertions(+), 17 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index eed073a21c..d12725ff4c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,9 @@ v1.2.alpha (XXXX-XX-XX) ----------------------- +* fixed issue #348: "HTTP Interface for Administration and Monitoring" + documentation errors. + * fix stringification of specific positive int64 values. Stringification of int64 values with the upper 32 bits cleared and the 33rd bit set were broken. diff --git a/Documentation/Examples/request-statistics b/Documentation/Examples/request-statistics index 9e67397f04..477b2675dc 100644 --- a/Documentation/Examples/request-statistics +++ b/Documentation/Examples/request-statistics @@ -11,6 +11,7 @@ HTTP/1.1 200 OK "cuts" : [0.01, 0.05, 0.1, 0.2, 0.5, 1], "count" : [1, 0], "mean" : [0.0, 0.0], + "min" : [0.0, "INF"], "max" : [0.0, "-INF"], "distribution" : [[1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0]] }, @@ -19,6 +20,7 @@ HTTP/1.1 200 OK "cuts" : [0.01, 0.05, 0.1, 0.2, 0.5, 1], "count" : [0, 0], "mean" : [0.0, 0.0], + "min" : ["INF", "INF"], "max" : ["-INF", "-INF"], "distribution" : [[0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0]] }, @@ -27,6 +29,7 @@ HTTP/1.1 200 OK "cuts" : [0.01, 0.05, 0.1, 0.2, 0.5, 1], "count" : [1, 0], "mean" : [0.0, 0.0], + "min" : [0.0, "INF"], "max" : [0.0, "-INF"], "distribution" : [[1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0]] }, @@ -35,6 +38,7 @@ HTTP/1.1 200 OK "cuts" : [250, 1000, 2000, 5000, 10000], "count" : [1, 0], "mean" : [1045, 0.0], + "min" : [1045, "INF"], "max" : [1045, "-INF"], "distribution" : [[0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0]] }, @@ -43,6 +47,7 @@ HTTP/1.1 200 OK "cuts" : [250, 1000, 2000, 5000, 10000], "count" : [1, 0], "mean" : [232, 0.0], + "min" : [232, "INF"], "max" : [232, "-INF"], "distribution" : [[1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]] } diff --git a/Documentation/Examples/request-statistics-current b/Documentation/Examples/request-statistics-current index 074c97332b..77bde1a06a 100644 --- a/Documentation/Examples/request-statistics-current +++ b/Documentation/Examples/request-statistics-current @@ -9,6 +9,7 @@ HTTP/1.1 200 OK "cuts" : [0.01, 0.05, 0.1, 0.2, 0.5, 1], "count" : 38611, "mean" : 0.000051798710212115704, + "min" : 0.0000005564, "max" : 1, "distribution" : [38609, 0, 0, 0, 0, 0, 2] }, @@ -17,6 +18,7 @@ HTTP/1.1 200 OK "cuts" : [0.01, 0.05, 0.1, 0.2, 0.5, 1], "count" : 0, "mean" : 0.0, + "min" : "INF", "max" : "-INF", "distribution" : [0, 0, 0, 0, 0, 0, 0] }, @@ -25,6 +27,7 @@ HTTP/1.1 200 OK "cuts" : [0.01, 0.05, 0.1, 0.2, 0.5, 1], "count" : 38611, "mean" : 0.000025899355106057852, + "min" : 0.00000174684866, "max" : 1, "distribution" : [38610, 0, 0, 0, 0, 0, 1] }, @@ -33,6 +36,7 @@ HTTP/1.1 200 OK "cuts" : [250, 1000, 2000, 5000, 10000], "count" : 38611, "mean" : 204.18145088187304736, + "min" : 168, "max" : 6477, "distribution" : [38609, 1, 0, 0, 1, 0] }, @@ -41,7 +45,8 @@ HTTP/1.1 200 OK "cuts" : [250, 1000, 2000, 5000, 10000], "count" : 38611, "mean" : 131.0053352671518496208, + "min" : 120, "max" : 236, "distribution" : [38611, 0, 0, 0, 0, 0] } -} \ No newline at end of file +} diff --git a/arangod/RestHandler/ConnectionStatisticsHandler.h b/arangod/RestHandler/ConnectionStatisticsHandler.h index f668276aa6..8aa4d5f3ce 100644 --- a/arangod/RestHandler/ConnectionStatisticsHandler.h +++ b/arangod/RestHandler/ConnectionStatisticsHandler.h @@ -119,10 +119,6 @@ namespace triagens { /// /// - @LIT{totalLength}: the number of available intervals. /// -/// - @LIT{totalTime}: the distribution of the total time. -/// -/// - @LIT{queueTime}: the distribution of the queue time. -/// /// - @LIT{httpConnections}: the number of opened http connections /// during the interval. /// diff --git a/arangod/RestHandler/RequestStatisticsHandler.h b/arangod/RestHandler/RequestStatisticsHandler.h index aec45abae9..97dd0e1151 100644 --- a/arangod/RestHandler/RequestStatisticsHandler.h +++ b/arangod/RestHandler/RequestStatisticsHandler.h @@ -138,6 +138,9 @@ namespace triagens { /// - @LIT{mean}: a list describing the mean of the values per time /// interval. This corresponds to the field @LIT{start}. /// +/// - @LIT{min}: a list describing the minimum of the values per time +/// interval. This corresponds to the field @LIT{start}. +/// /// - @LIT{max}: a list describing the maximum of the values per time /// interval. This corresponds to the field @LIT{start}. /// diff --git a/lib/Statistics/statistics.cpp b/lib/Statistics/statistics.cpp index 0e8e600338..214176e19e 100644 --- a/lib/Statistics/statistics.cpp +++ b/lib/Statistics/statistics.cpp @@ -613,28 +613,28 @@ VariantArray* TRI_StatisticsInfo (TRI_statistics_granularity_e granularity, result->add("start", new VariantUInt32((uint32_t) t[0])); if (showTotalTime) { - RRF_GenerateVariantDistribution(result, blocks[0], "totalTime", true, false, false); + RRF_GenerateVariantDistribution(result, blocks[0], "totalTime", true, true, false); } if (showQueueTime) { - RRF_GenerateVariantDistribution(result, blocks[0], "queueTime", true, false, false); + RRF_GenerateVariantDistribution(result, blocks[0], "queueTime", true, true, false); } if (showRequestTime) { - RRF_GenerateVariantDistribution(result, blocks[0], "requestTime", true, false, false); + RRF_GenerateVariantDistribution(result, blocks[0], "requestTime", true, true, false); } if (showBytesSent) { - RRF_GenerateVariantDistribution(result, blocks[0], "bytesSent", true, false, false); + RRF_GenerateVariantDistribution(result, blocks[0], "bytesSent", true, true, false); } if (showBytesReceived) { - RRF_GenerateVariantDistribution(result, blocks[0], "bytesReceived", true, false, false); + RRF_GenerateVariantDistribution(result, blocks[0], "bytesReceived", true, true, false); } if (showHttp) { RRF_GenerateVariantCounter(result, blocks[0], "httpConnections", resolution); - RRF_GenerateVariantDistribution(result, blocks[0], "httpDuration", true, false, false); + RRF_GenerateVariantDistribution(result, blocks[0], "httpDuration", true, true, false); } } @@ -670,28 +670,28 @@ VariantArray* TRI_StatisticsInfo (TRI_statistics_granularity_e granularity, result->add("totalLength", new VariantUInt64(total)); if (showTotalTime) { - RRF_GenerateVariantDistribution(result, blocks, "totalTime", true, false, false); + RRF_GenerateVariantDistribution(result, blocks, "totalTime", true, true, false); } if (showQueueTime) { - RRF_GenerateVariantDistribution(result, blocks, "queueTime", true, false, false); + RRF_GenerateVariantDistribution(result, blocks, "queueTime", true, true, false); } if (showRequestTime) { - RRF_GenerateVariantDistribution(result, blocks, "requestTime", true, false, false); + RRF_GenerateVariantDistribution(result, blocks, "requestTime", true, true, false); } if (showBytesSent) { - RRF_GenerateVariantDistribution(result, blocks, "bytesSent", true, false, false); + RRF_GenerateVariantDistribution(result, blocks, "bytesSent", true, true, false); } if (showBytesReceived) { - RRF_GenerateVariantDistribution(result, blocks, "bytesReceived", true, false, false); + RRF_GenerateVariantDistribution(result, blocks, "bytesReceived", true, true, false); } if (showHttp) { RRF_GenerateVariantCounter(result, blocks, "httpConnections", resolution); - RRF_GenerateVariantDistribution(result, blocks, "httpDuration", true, false, false); + RRF_GenerateVariantDistribution(result, blocks, "httpDuration", true, true, false); } }