From 34b96e54f4e50861c1f9cca34aa5c196cfcccbdd Mon Sep 17 00:00:00 2001 From: Otto van der Schaaf Date: Wed, 10 Jun 2020 11:26:04 +0200 Subject: [PATCH 1/3] CLI: Avoid exceeding column size when rendering percentile Fixes #352 Signed-off-by: Otto van der Schaaf --- source/client/output_formatter_impl.cc | 3 +- test/BUILD | 5 +- test/output_formatter_test.cc | 7 ++ .../output_formatter.medium.txt.gold | 67 +++++++++++++++++++ 4 files changed, 79 insertions(+), 3 deletions(-) create mode 100644 test/test_data/output_formatter.medium.txt.gold diff --git a/source/client/output_formatter_impl.cc b/source/client/output_formatter_impl.cc index c438179a3..c41af0f5d 100644 --- a/source/client/output_formatter_impl.cc +++ b/source/client/output_formatter_impl.cc @@ -90,7 +90,8 @@ std::string ConsoleOutputFormatterImpl::formatProto(const nighthawk::client::Out << std::endl; header_written = true; } - ss << fmt::format(" {:<{}}{:<{}}{:<{}}", p, 12, percentile.count(), 12, + auto s_percentile = fmt::format("{:.{}g}", p, 3); + ss << fmt::format(" {:<{}}{:<{}}{:<{}}", s_percentile, 12, percentile.count(), 12, percentile.has_duration() ? formatProtoDuration(percentile.duration()) : fmt::format("{}", static_cast(percentile.raw_value())), diff --git a/test/BUILD b/test/BUILD index 29cce7730..b1d882887 100644 --- a/test/BUILD +++ b/test/BUILD @@ -1,11 +1,11 @@ -licenses(["notice"]) # Apache 2 - load( "@envoy//bazel:envoy_build_system.bzl", "envoy_cc_test", "envoy_package", ) +licenses(["notice"]) # Apache 2 + envoy_package() envoy_cc_test( @@ -103,6 +103,7 @@ envoy_cc_test( "test_data/output_formatter.json.gold", "test_data/output_formatter.medium.fortio.gold", "test_data/output_formatter.medium.proto.gold", + "test_data/output_formatter.medium.txt.gold", "test_data/output_formatter.txt.gold", "test_data/output_formatter.yaml.gold", ], diff --git a/test/output_formatter_test.cc b/test/output_formatter_test.cc index 4878c9b89..e7eb0db88 100644 --- a/test/output_formatter_test.cc +++ b/test/output_formatter_test.cc @@ -192,6 +192,13 @@ TEST_F(MediumOutputCollectorTest, FortioFormatter) { "test/test_data/output_formatter.medium.fortio.gold"); } +TEST_F(MediumOutputCollectorTest, ConsoleOutputFormatter) { + const auto input_proto = loadProtoFromFile("test/test_data/output_formatter.medium.proto.gold"); + ConsoleOutputFormatterImpl formatter; + expectEqualToGoldFile(formatter.formatProto(input_proto), + "test/test_data/output_formatter.medium.txt.gold"); +} + class StatidToNameTest : public Test {}; TEST_F(StatidToNameTest, TestTranslations) { diff --git a/test/test_data/output_formatter.medium.txt.gold b/test/test_data/output_formatter.medium.txt.gold new file mode 100644 index 000000000..47a28285f --- /dev/null +++ b/test/test_data/output_formatter.medium.txt.gold @@ -0,0 +1,67 @@ +Nighthawk - A layer 7 protocol benchmarking tool. + +Queueing and connection setup latency (53 samples) + min: 0s 000ms 015us | mean: 0s 010ms 201us | max: 0s 210ms 903us | pstdev: 0s 042ms 017us + + Percentile Count Value + 0.5 27 0s 000ms 018us + 0.75 40 0s 000ms 025us + 0.8 43 0s 000ms 026us + 0.9 48 0s 000ms 036us + 0.95 51 0s 147ms 341us + +Request start to response end (53 samples) + min: 0s 053ms 798us | mean: 0s 078ms 433us | max: 0s 310ms 886us | pstdev: 0s 050ms 523us + + Percentile Count Value + 0.5 27 0s 065ms 077us + 0.75 40 0s 074ms 465us + 0.8 43 0s 078ms 065us + 0.9 48 0s 085ms 045us + 0.95 51 0s 247ms 513us + +Response body size in bytes (56 samples) + min: 847 | mean: 847.0 | max: 847 | pstdev: 0.0 + +Response header size in bytes (56 samples) + min: 47257 | mean: 47314.5 | max: 47357 | pstdev: 20.79921014983845 + + Percentile Count Value + 0.5 31 47317 + 0.75 42 47327 + 0.8 47 47331 + 0.9 51 47339 + 0.95 55 47353 + +Initiation to completion (57 samples) + min: 0s 000ms 025us | mean: 0s 082ms 438us | max: 0s 310ms 935us | pstdev: 0s 067ms 986us + + Percentile Count Value + 0.5 29 0s 064ms 466us + 0.75 43 0s 073ms 768us + 0.8 46 0s 075ms 849us + 0.9 52 0s 238ms 026us + 0.95 55 0s 281ms 395us + +Counter Value Per second +benchmark.http_2xx 56 28.00 +benchmark.pool_overflow 4 2.00 +cluster_manager.cluster_added 3 1.50 +default.total_match_count 3 1.50 +membership_change 3 1.50 +runtime.load_success 1 0.50 +runtime.override_dir_not_exists 1 0.50 +ssl.ciphers.ECDHE-RSA-AES128-GCM-SHA256 6 3.00 +ssl.curves.X25519 6 3.00 +ssl.handshake 6 3.00 +ssl.session_reused 3 1.50 +ssl.sigalgs.rsa_pss_rsae_sha256 6 3.00 +ssl.versions.TLSv1.2 6 3.00 +upstream_cx_http1_total 6 3.00 +upstream_cx_rx_bytes_total 2702142 1351070.71 +upstream_cx_total 6 3.00 +upstream_cx_tx_bytes_total 3528 1764.00 +upstream_rq_pending_overflow 4 2.00 +upstream_rq_pending_total 6 3.00 +upstream_rq_total 56 28.00 + From 7fbf0310256e71bd96e833171285bbebc40927e9 Mon Sep 17 00:00:00 2001 From: Otto van der Schaaf Date: Wed, 10 Jun 2020 11:58:17 +0200 Subject: [PATCH 2/3] nail it better in the test Signed-off-by: Otto van der Schaaf --- source/client/output_formatter_impl.cc | 2 +- test/BUILD | 7 +- test/output_formatter_test.cc | 4 +- test/test_data/large-sample.json | 1084 +++++++++++++++++ .../test_data/output_formatter.large.txt.gold | 60 + .../output_formatter.medium.txt.gold | 67 - 6 files changed, 1151 insertions(+), 73 deletions(-) create mode 100644 test/test_data/large-sample.json create mode 100644 test/test_data/output_formatter.large.txt.gold delete mode 100644 test/test_data/output_formatter.medium.txt.gold diff --git a/source/client/output_formatter_impl.cc b/source/client/output_formatter_impl.cc index c41af0f5d..ecc708c88 100644 --- a/source/client/output_formatter_impl.cc +++ b/source/client/output_formatter_impl.cc @@ -90,7 +90,7 @@ std::string ConsoleOutputFormatterImpl::formatProto(const nighthawk::client::Out << std::endl; header_written = true; } - auto s_percentile = fmt::format("{:.{}g}", p, 3); + auto s_percentile = fmt::format("{:.{}g}", p, 8); ss << fmt::format(" {:<{}}{:<{}}{:<{}}", s_percentile, 12, percentile.count(), 12, percentile.has_duration() ? formatProtoDuration(percentile.duration()) diff --git a/test/BUILD b/test/BUILD index b1d882887..e72f80fd5 100644 --- a/test/BUILD +++ b/test/BUILD @@ -1,11 +1,11 @@ +licenses(["notice"]) # Apache 2 + load( "@envoy//bazel:envoy_build_system.bzl", "envoy_cc_test", "envoy_package", ) -licenses(["notice"]) # Apache 2 - envoy_package() envoy_cc_test( @@ -99,11 +99,12 @@ envoy_cc_test( name = "output_formatter_test", srcs = ["output_formatter_test.cc"], data = [ + "test_data/large-sample.json", "test_data/output_formatter.dotted.gold", "test_data/output_formatter.json.gold", + "test_data/output_formatter.large.txt.gold", "test_data/output_formatter.medium.fortio.gold", "test_data/output_formatter.medium.proto.gold", - "test_data/output_formatter.medium.txt.gold", "test_data/output_formatter.txt.gold", "test_data/output_formatter.yaml.gold", ], diff --git a/test/output_formatter_test.cc b/test/output_formatter_test.cc index e7eb0db88..cdea8cb14 100644 --- a/test/output_formatter_test.cc +++ b/test/output_formatter_test.cc @@ -193,10 +193,10 @@ TEST_F(MediumOutputCollectorTest, FortioFormatter) { } TEST_F(MediumOutputCollectorTest, ConsoleOutputFormatter) { - const auto input_proto = loadProtoFromFile("test/test_data/output_formatter.medium.proto.gold"); + const auto input_proto = loadProtoFromFile("test/test_data/large-sample.json"); ConsoleOutputFormatterImpl formatter; expectEqualToGoldFile(formatter.formatProto(input_proto), - "test/test_data/output_formatter.medium.txt.gold"); + "test/test_data/output_formatter.large.txt.gold"); } class StatidToNameTest : public Test {}; diff --git a/test/test_data/large-sample.json b/test/test_data/large-sample.json new file mode 100644 index 000000000..6618136da --- /dev/null +++ b/test/test_data/large-sample.json @@ -0,0 +1,1084 @@ +{ + "options": { + "verbosity": { + "value": "INFO" + }, + "output_format": { + "value": "JSON" + }, + "address_family": { + "value": "AUTO" + }, + "request_options": { + "request_method": "GET", + "request_headers": [] + }, + "tls_context": { + "sni": "", + "allow_renegotiation": false + }, + "sequencer_idle_strategy": { + "value": "SPIN" + }, + "experimental_h1_connection_reuse_strategy": { + "value": "MRU" + }, + "termination_predicates": {}, + "failure_predicates": { + "benchmark.http_5xx": "0", + "requestsource.upstream_rq_5xx": "0", + "benchmark.pool_connection_failure": "0", + "benchmark.http_4xx": "0" + }, + "labels": [], + "requests_per_second": 2000, + "connections": 100, + "duration": "5s", + "timeout": "30s", + "h2": false, + "concurrency": "1", + "prefetch_connections": false, + "burst_size": 0, + "max_pending_requests": 0, + "max_active_requests": 100, + "max_requests_per_connection": 4294937295, + "uri": "www.we-amp.com", + "trace": "", + "open_loop": true, + "experimental_h2_use_multiple_connections": false, + "nighthawk_service": "", + "simple_warmup": false + }, + "results": [ + { + "name": "global", + "statistics": [ + { + "count": "1368", + "id": "benchmark_http_client.queue_to_connect", + "percentiles": [ + { + "percentile": 0, + "count": "1", + "duration": "0.000055253s" + }, + { + "percentile": 0.1, + "count": "137", + "duration": "0.000067983s" + }, + { + "percentile": 0.2, + "count": "274", + "duration": "0.000068599s" + }, + { + "percentile": 0.3, + "count": "412", + "duration": "0.000069107s" + }, + { + "percentile": 0.4, + "count": "548", + "duration": "0.000069731s" + }, + { + "percentile": 0.5, + "count": "684", + "duration": "0.000070499s" + }, + { + "percentile": 0.55, + "count": "753", + "duration": "0.000070903s" + }, + { + "percentile": 0.6, + "count": "821", + "duration": "0.000071807s" + }, + { + "percentile": 0.65, + "count": "890", + "duration": "0.000084791s" + }, + { + "percentile": 0.7, + "count": "958", + "duration": "0.000720063s" + }, + { + "percentile": 0.75, + "count": "1026", + "duration": "0.001486591s" + }, + { + "percentile": 0.775, + "count": "1061", + "duration": "0.002796159s" + }, + { + "percentile": 0.8, + "count": "1095", + "duration": "0.003707007s" + }, + { + "percentile": 0.825, + "count": "1129", + "duration": "0.004838399s" + }, + { + "percentile": 0.85, + "count": "1163", + "duration": "0.005854975s" + }, + { + "percentile": 0.875, + "count": "1197", + "duration": "0.007474431s" + }, + { + "percentile": 0.8875, + "count": "1215", + "duration": "0.008835071s" + }, + { + "percentile": 0.9, + "count": "1232", + "duration": "0.009914367s" + }, + { + "percentile": 0.9125, + "count": "1249", + "duration": "0.011802111s" + }, + { + "percentile": 0.925, + "count": "1266", + "duration": "0.013372927s" + }, + { + "percentile": 0.9375, + "count": "1283", + "duration": "0.015265279s" + }, + { + "percentile": 0.94375, + "count": "1292", + "duration": "0.017459199s" + }, + { + "percentile": 0.95, + "count": "1300", + "duration": "0.018770943s" + }, + { + "percentile": 0.95625, + "count": "1309", + "duration": "0.020772863s" + }, + { + "percentile": 0.9625, + "count": "1317", + "duration": "0.022490111s" + }, + { + "percentile": 0.96875, + "count": "1326", + "duration": "0.025802751s" + }, + { + "percentile": 0.971875, + "count": "1330", + "duration": "0.026951679s" + }, + { + "percentile": 0.975, + "count": "1334", + "duration": "0.028279807s" + }, + { + "percentile": 0.978125, + "count": "1339", + "duration": "0.031925247s" + }, + { + "percentile": 0.98125, + "count": "1343", + "duration": "0.035825663s" + }, + { + "percentile": 0.984375, + "count": "1347", + "duration": "0.038993919s" + }, + { + "percentile": 0.9859375, + "count": "1349", + "duration": "0.041373695s" + }, + { + "percentile": 0.9875, + "count": "1351", + "duration": "0.043419647s" + }, + { + "percentile": 0.9890625, + "count": "1354", + "duration": "0.053880831s" + }, + { + "percentile": 0.990625, + "count": "1356", + "duration": "0.059416575s" + }, + { + "percentile": 0.9921875, + "count": "1358", + "duration": "0.065710079s" + }, + { + "percentile": 0.99296875, + "count": "1359", + "duration": "0.067395583s" + }, + { + "percentile": 0.99375, + "count": "1360", + "duration": "0.075341823s" + }, + { + "percentile": 0.99453125, + "count": "1361", + "duration": "0.077434879s" + }, + { + "percentile": 0.9953125, + "count": "1362", + "duration": "0.080871423s" + }, + { + "percentile": 0.99609375, + "count": "1363", + "duration": "0.085630975s" + }, + { + "percentile": 0.996484375, + "count": "1364", + "duration": "0.091783167s" + }, + { + "percentile": 0.996875, + "count": "1364", + "duration": "0.091783167s" + }, + { + "percentile": 0.997265625, + "count": "1365", + "duration": "0.091828223s" + }, + { + "percentile": 0.99765625, + "count": "1365", + "duration": "0.091828223s" + }, + { + "percentile": 0.998046875, + "count": "1366", + "duration": "0.093204479s" + }, + { + "percentile": 0.9982421875, + "count": "1366", + "duration": "0.093204479s" + }, + { + "percentile": 0.9984375, + "count": "1366", + "duration": "0.093204479s" + }, + { + "percentile": 0.9986328125, + "count": "1367", + "duration": "0.093671423s" + }, + { + "percentile": 0.998828125, + "count": "1367", + "duration": "0.093671423s" + }, + { + "percentile": 0.9990234375, + "count": "1367", + "duration": "0.093671423s" + }, + { + "percentile": 0.99912109375, + "count": "1367", + "duration": "0.093671423s" + }, + { + "percentile": 0.99921875, + "count": "1367", + "duration": "0.093671423s" + }, + { + "percentile": 0.99931640625, + "count": "1368", + "duration": "0.094236671s" + }, + { + "percentile": 1, + "count": "1368", + "duration": "0.094236671s" + } + ], + "mean": "0.003489878s", + "pstdev": "0.010093363s", + "min": "0.000055253s", + "max": "0.094236671s" + }, + { + "count": "1317", + "id": "benchmark_http_client.request_to_response", + "percentiles": [ + { + "percentile": 0, + "count": "1", + "duration": "0.085323775s" + }, + { + "percentile": 0.1, + "count": "132", + "duration": "0.089104383s" + }, + { + "percentile": 0.2, + "count": "266", + "duration": "0.090038271s" + }, + { + "percentile": 0.3, + "count": "396", + "duration": "0.091021311s" + }, + { + "percentile": 0.4, + "count": "527", + "duration": "0.091930623s" + }, + { + "percentile": 0.5, + "count": "659", + "duration": "0.092962815s" + }, + { + "percentile": 0.55, + "count": "726", + "duration": "0.093470719s" + }, + { + "percentile": 0.6, + "count": "792", + "duration": "0.093925375s" + }, + { + "percentile": 0.65, + "count": "857", + "duration": "0.094400511s" + }, + { + "percentile": 0.7, + "count": "923", + "duration": "0.094887935s" + }, + { + "percentile": 0.75, + "count": "988", + "duration": "0.095383551s" + }, + { + "percentile": 0.775, + "count": "1021", + "duration": "0.095690751s" + }, + { + "percentile": 0.8, + "count": "1054", + "duration": "0.095977471s" + }, + { + "percentile": 0.825, + "count": "1087", + "duration": "0.096333823s" + }, + { + "percentile": 0.85, + "count": "1120", + "duration": "0.096927743s" + }, + { + "percentile": 0.875, + "count": "1153", + "duration": "0.097488895s" + }, + { + "percentile": 0.8875, + "count": "1169", + "duration": "0.097800191s" + }, + { + "percentile": 0.9, + "count": "1186", + "duration": "0.098242559s" + }, + { + "percentile": 0.9125, + "count": "1203", + "duration": "0.099246079s" + }, + { + "percentile": 0.925, + "count": "1219", + "duration": "0.100515839s" + }, + { + "percentile": 0.9375, + "count": "1235", + "duration": "0.101728255s" + }, + { + "percentile": 0.94375, + "count": "1243", + "duration": "0.101879807s" + }, + { + "percentile": 0.95, + "count": "1252", + "duration": "0.102346751s" + }, + { + "percentile": 0.95625, + "count": "1260", + "duration": "0.102588415s" + }, + { + "percentile": 0.9625, + "count": "1268", + "duration": "0.103333887s" + }, + { + "percentile": 0.96875, + "count": "1276", + "duration": "0.103792639s" + }, + { + "percentile": 0.971875, + "count": "1280", + "duration": "0.104132607s" + }, + { + "percentile": 0.975, + "count": "1286", + "duration": "0.104755199s" + }, + { + "percentile": 0.978125, + "count": "1289", + "duration": "0.105213951s" + }, + { + "percentile": 0.98125, + "count": "1293", + "duration": "0.105852927s" + }, + { + "percentile": 0.984375, + "count": "1297", + "duration": "0.106606591s" + }, + { + "percentile": 0.9859375, + "count": "1299", + "duration": "0.107266047s" + }, + { + "percentile": 0.9875, + "count": "1301", + "duration": "0.107794431s" + }, + { + "percentile": 0.9890625, + "count": "1303", + "duration": "0.108445695s" + }, + { + "percentile": 0.990625, + "count": "1305", + "duration": "0.109101055s" + }, + { + "percentile": 0.9921875, + "count": "1307", + "duration": "0.109215743s" + }, + { + "percentile": 0.99296875, + "count": "1308", + "duration": "0.109264895s" + }, + { + "percentile": 0.99375, + "count": "1309", + "duration": "0.109727743s" + }, + { + "percentile": 0.99453125, + "count": "1310", + "duration": "0.109748223s" + }, + { + "percentile": 0.9953125, + "count": "1311", + "duration": "0.109780991s" + }, + { + "percentile": 0.99609375, + "count": "1312", + "duration": "0.109879295s" + }, + { + "percentile": 0.996484375, + "count": "1313", + "duration": "0.110555135s" + }, + { + "percentile": 0.996875, + "count": "1313", + "duration": "0.110555135s" + }, + { + "percentile": 0.997265625, + "count": "1314", + "duration": "0.110731263s" + }, + { + "percentile": 0.99765625, + "count": "1314", + "duration": "0.110731263s" + }, + { + "percentile": 0.998046875, + "count": "1315", + "duration": "0.110784511s" + }, + { + "percentile": 0.9982421875, + "count": "1315", + "duration": "0.110784511s" + }, + { + "percentile": 0.9984375, + "count": "1315", + "duration": "0.110784511s" + }, + { + "percentile": 0.9986328125, + "count": "1316", + "duration": "0.111198207s" + }, + { + "percentile": 0.998828125, + "count": "1316", + "duration": "0.111198207s" + }, + { + "percentile": 0.9990234375, + "count": "1316", + "duration": "0.111198207s" + }, + { + "percentile": 0.99912109375, + "count": "1316", + "duration": "0.111198207s" + }, + { + "percentile": 0.99921875, + "count": "1316", + "duration": "0.111198207s" + }, + { + "percentile": 0.99931640625, + "count": "1317", + "duration": "0.112316415s" + }, + { + "percentile": 1, + "count": "1317", + "duration": "0.112316415s" + } + ], + "mean": "0.093536335s", + "pstdev": "0.004224355s", + "min": "0.085323775s", + "max": "0.112316415s" + }, + { + "count": "1317", + "id": "benchmark_http_client.response_body_size", + "percentiles": [], + "raw_mean": 146, + "raw_pstdev": 0, + "raw_min": "146", + "raw_max": "146" + }, + { + "count": "1317", + "id": "benchmark_http_client.response_header_size", + "percentiles": [], + "raw_mean": 151, + "raw_pstdev": 0, + "raw_min": "151", + "raw_max": "151" + }, + { + "count": "0", + "id": "sequencer.blocking", + "percentiles": [ + { + "percentile": 1, + "count": "0", + "duration": "0s" + } + ], + "mean": "0s", + "pstdev": "0s", + "min": "0s", + "max": "0s" + }, + { + "count": "9948", + "id": "sequencer.callback", + "percentiles": [ + { + "percentile": 0, + "count": "1", + "duration": "0.000045675s" + }, + { + "percentile": 0.1, + "count": "995", + "duration": "0.000047861s" + }, + { + "percentile": 0.2, + "count": "1995", + "duration": "0.000048215s" + }, + { + "percentile": 0.3, + "count": "2989", + "duration": "0.000048569s" + }, + { + "percentile": 0.4, + "count": "3984", + "duration": "0.000048917s" + }, + { + "percentile": 0.5, + "count": "4975", + "duration": "0.000049209s" + }, + { + "percentile": 0.55, + "count": "5472", + "duration": "0.000049361s" + }, + { + "percentile": 0.6, + "count": "5969", + "duration": "0.000049553s" + }, + { + "percentile": 0.65, + "count": "6469", + "duration": "0.000049795s" + }, + { + "percentile": 0.7, + "count": "6967", + "duration": "0.000050303s" + }, + { + "percentile": 0.75, + "count": "7462", + "duration": "0.000051087s" + }, + { + "percentile": 0.775, + "count": "7710", + "duration": "0.000051541s" + }, + { + "percentile": 0.8, + "count": "7959", + "duration": "0.000052147s" + }, + { + "percentile": 0.825, + "count": "8208", + "duration": "0.000059921s" + }, + { + "percentile": 0.85, + "count": "8456", + "duration": "0.000062641s" + }, + { + "percentile": 0.875, + "count": "8705", + "duration": "0.089055231s" + }, + { + "percentile": 0.8875, + "count": "8829", + "duration": "0.090411007s" + }, + { + "percentile": 0.9, + "count": "8955", + "duration": "0.091602943s" + }, + { + "percentile": 0.9125, + "count": "9078", + "duration": "0.092766207s" + }, + { + "percentile": 0.925, + "count": "9202", + "duration": "0.093822975s" + }, + { + "percentile": 0.9375, + "count": "9327", + "duration": "0.094846975s" + }, + { + "percentile": 0.94375, + "count": "9389", + "duration": "0.095350783s" + }, + { + "percentile": 0.95, + "count": "9451", + "duration": "0.095879167s" + }, + { + "percentile": 0.95625, + "count": "9513", + "duration": "0.096555007s" + }, + { + "percentile": 0.9625, + "count": "9575", + "duration": "0.097349631s" + }, + { + "percentile": 0.96875, + "count": "9638", + "duration": "0.098549759s" + }, + { + "percentile": 0.971875, + "count": "9669", + "duration": "0.099536895s" + }, + { + "percentile": 0.975, + "count": "9700", + "duration": "0.100904959s" + }, + { + "percentile": 0.978125, + "count": "9732", + "duration": "0.102014975s" + }, + { + "percentile": 0.98125, + "count": "9762", + "duration": "0.103227391s" + }, + { + "percentile": 0.984375, + "count": "9793", + "duration": "0.105037823s" + }, + { + "percentile": 0.9859375, + "count": "9809", + "duration": "0.106287103s" + }, + { + "percentile": 0.9875, + "count": "9824", + "duration": "0.107143167s" + }, + { + "percentile": 0.9890625, + "count": "9840", + "duration": "0.108556287s" + }, + { + "percentile": 0.990625, + "count": "9855", + "duration": "0.109854719s" + }, + { + "percentile": 0.9921875, + "count": "9871", + "duration": "0.112148479s" + }, + { + "percentile": 0.99296875, + "count": "9879", + "duration": "0.112934911s" + }, + { + "percentile": 0.99375, + "count": "9886", + "duration": "0.113938431s" + }, + { + "percentile": 0.99453125, + "count": "9894", + "duration": "0.114872319s" + }, + { + "percentile": 0.9953125, + "count": "9902", + "duration": "0.116215807s" + }, + { + "percentile": 0.99609375, + "count": "9910", + "duration": "0.118276095s" + }, + { + "percentile": 0.996484375, + "count": "9914", + "duration": "0.121716735s" + }, + { + "percentile": 0.996875, + "count": "9917", + "duration": "0.123699199s" + }, + { + "percentile": 0.997265625, + "count": "9921", + "duration": "0.125431807s" + }, + { + "percentile": 0.99765625, + "count": "9925", + "duration": "0.130064383s" + }, + { + "percentile": 0.998046875, + "count": "9929", + "duration": "0.133173247s" + }, + { + "percentile": 0.9982421875, + "count": "9931", + "duration": "0.136265727s" + }, + { + "percentile": 0.9984375, + "count": "9933", + "duration": "0.141279231s" + }, + { + "percentile": 0.9986328125, + "count": "9935", + "duration": "0.150364159s" + }, + { + "percentile": 0.998828125, + "count": "9937", + "duration": "0.155402239s" + }, + { + "percentile": 0.9990234375, + "count": "9939", + "duration": "0.160137215s" + }, + { + "percentile": 0.99912109375, + "count": "9940", + "duration": "0.163037183s" + }, + { + "percentile": 0.99921875, + "count": "9941", + "duration": "0.171376639s" + }, + { + "percentile": 0.99931640625, + "count": "9942", + "duration": "0.175144959s" + }, + { + "percentile": 0.9994140625, + "count": "9943", + "duration": "0.181329919s" + }, + { + "percentile": 0.99951171875, + "count": "9944", + "duration": "0.181829631s" + }, + { + "percentile": 0.999560546875, + "count": "9944", + "duration": "0.181829631s" + }, + { + "percentile": 0.999609375, + "count": "9945", + "duration": "0.185434111s" + }, + { + "percentile": 0.999658203125, + "count": "9945", + "duration": "0.185434111s" + }, + { + "percentile": 0.99970703125, + "count": "9946", + "duration": "0.190472191s" + }, + { + "percentile": 0.999755859375, + "count": "9946", + "duration": "0.190472191s" + }, + { + "percentile": 0.9997802734375, + "count": "9946", + "duration": "0.190472191s" + }, + { + "percentile": 0.9998046875, + "count": "9947", + "duration": "0.192315391s" + }, + { + "percentile": 0.9998291015625, + "count": "9947", + "duration": "0.192315391s" + }, + { + "percentile": 0.999853515625, + "count": "9947", + "duration": "0.192315391s" + }, + { + "percentile": 0.9998779296875, + "count": "9947", + "duration": "0.192315391s" + }, + { + "percentile": 0.99989013671875, + "count": "9947", + "duration": "0.192315391s" + }, + { + "percentile": 0.99990234375, + "count": "9948", + "duration": "0.194347007s" + }, + { + "percentile": 1, + "count": "9948", + "duration": "0.194347007s" + } + ], + "mean": "0.012904538s", + "pstdev": "0.033144393s", + "min": "0.000045675s", + "max": "0.194347007s" + } + ], + "counters": [ + { + "name": "benchmark.http_3xx", + "value": "1317" + }, + { + "name": "benchmark.pool_overflow", + "value": "8631" + }, + { + "name": "cluster_manager.cluster_added", + "value": "1" + }, + { + "name": "default.total_match_count", + "value": "1" + }, + { + "name": "membership_change", + "value": "1" + }, + { + "name": "runtime.load_success", + "value": "1" + }, + { + "name": "runtime.override_dir_not_exists", + "value": "1" + }, + { + "name": "upstream_cx_http1_total", + "value": "52" + }, + { + "name": "upstream_cx_rx_bytes_total", + "value": "449097" + }, + { + "name": "upstream_cx_total", + "value": "52" + }, + { + "name": "upstream_cx_tx_bytes_total", + "value": "84816" + }, + { + "name": "upstream_rq_pending_overflow", + "value": "8631" + }, + { + "name": "upstream_rq_pending_total", + "value": "451" + }, + { + "name": "upstream_rq_total", + "value": "1368" + } + ], + "execution_duration": "5.000010451s" + } + ], + "version": { + "version": { + "major_number": 0, + "minor_number": 3, + "patch": 0 + } + }, + "timestamp": "2020-06-10T09:47:06.915922617Z" +} diff --git a/test/test_data/output_formatter.large.txt.gold b/test/test_data/output_formatter.large.txt.gold new file mode 100644 index 000000000..9bcc9a942 --- /dev/null +++ b/test/test_data/output_formatter.large.txt.gold @@ -0,0 +1,60 @@ +Nighthawk - A layer 7 protocol benchmarking tool. + +Queueing and connection setup latency (1368 samples) + min: 0s 000ms 055us | mean: 0s 003ms 489us | max: 0s 094ms 236us | pstdev: 0s 010ms 093us + + Percentile Count Value + 0.5 684 0s 000ms 070us + 0.75 1026 0s 001ms 486us + 0.8 1095 0s 003ms 707us + 0.9 1232 0s 009ms 914us + 0.95 1300 0s 018ms 770us + 0.990625 1356 0s 059ms 416us + 0.99902344 1367 0s 093ms 671us + +Request start to response end (1317 samples) + min: 0s 085ms 323us | mean: 0s 093ms 536us | max: 0s 112ms 316us | pstdev: 0s 004ms 224us + + Percentile Count Value + 0.5 659 0s 092ms 962us + 0.75 988 0s 095ms 383us + 0.8 1054 0s 095ms 977us + 0.9 1186 0s 098ms 242us + 0.95 1252 0s 102ms 346us + 0.990625 1305 0s 109ms 101us + 0.99902344 1316 0s 111ms 198us + +Response body size in bytes (1317 samples) + min: 146 | mean: 146.0 | max: 146 | pstdev: 0.0 + +Response header size in bytes (1317 samples) + min: 151 | mean: 151.0 | max: 151 | pstdev: 0.0 + +Initiation to completion (9948 samples) + min: 0s 000ms 045us | mean: 0s 012ms 904us | max: 0s 194ms 347us | pstdev: 0s 033ms 144us + + Percentile Count Value + 0.5 4975 0s 000ms 049us + 0.75 7462 0s 000ms 051us + 0.8 7959 0s 000ms 052us + 0.9 8955 0s 091ms 602us + 0.95 9451 0s 095ms 879us + 0.990625 9855 0s 109ms 854us + 0.99902344 9939 0s 160ms 137us + +Counter Value Per second +benchmark.http_3xx 1317 263.40 +benchmark.pool_overflow 8631 1726.20 +cluster_manager.cluster_added 1 0.20 +default.total_match_count 1 0.20 +membership_change 1 0.20 +runtime.load_success 1 0.20 +runtime.override_dir_not_exists 1 0.20 +upstream_cx_http1_total 52 10.40 +upstream_cx_rx_bytes_total 449097 89819.21 +upstream_cx_total 52 10.40 +upstream_cx_tx_bytes_total 84816 16963.16 +upstream_rq_pending_overflow 8631 1726.20 +upstream_rq_pending_total 451 90.20 +upstream_rq_total 1368 273.60 + diff --git a/test/test_data/output_formatter.medium.txt.gold b/test/test_data/output_formatter.medium.txt.gold deleted file mode 100644 index 47a28285f..000000000 --- a/test/test_data/output_formatter.medium.txt.gold +++ /dev/null @@ -1,67 +0,0 @@ -Nighthawk - A layer 7 protocol benchmarking tool. - -Queueing and connection setup latency (53 samples) - min: 0s 000ms 015us | mean: 0s 010ms 201us | max: 0s 210ms 903us | pstdev: 0s 042ms 017us - - Percentile Count Value - 0.5 27 0s 000ms 018us - 0.75 40 0s 000ms 025us - 0.8 43 0s 000ms 026us - 0.9 48 0s 000ms 036us - 0.95 51 0s 147ms 341us - -Request start to response end (53 samples) - min: 0s 053ms 798us | mean: 0s 078ms 433us | max: 0s 310ms 886us | pstdev: 0s 050ms 523us - - Percentile Count Value - 0.5 27 0s 065ms 077us - 0.75 40 0s 074ms 465us - 0.8 43 0s 078ms 065us - 0.9 48 0s 085ms 045us - 0.95 51 0s 247ms 513us - -Response body size in bytes (56 samples) - min: 847 | mean: 847.0 | max: 847 | pstdev: 0.0 - -Response header size in bytes (56 samples) - min: 47257 | mean: 47314.5 | max: 47357 | pstdev: 20.79921014983845 - - Percentile Count Value - 0.5 31 47317 - 0.75 42 47327 - 0.8 47 47331 - 0.9 51 47339 - 0.95 55 47353 - -Initiation to completion (57 samples) - min: 0s 000ms 025us | mean: 0s 082ms 438us | max: 0s 310ms 935us | pstdev: 0s 067ms 986us - - Percentile Count Value - 0.5 29 0s 064ms 466us - 0.75 43 0s 073ms 768us - 0.8 46 0s 075ms 849us - 0.9 52 0s 238ms 026us - 0.95 55 0s 281ms 395us - -Counter Value Per second -benchmark.http_2xx 56 28.00 -benchmark.pool_overflow 4 2.00 -cluster_manager.cluster_added 3 1.50 -default.total_match_count 3 1.50 -membership_change 3 1.50 -runtime.load_success 1 0.50 -runtime.override_dir_not_exists 1 0.50 -ssl.ciphers.ECDHE-RSA-AES128-GCM-SHA256 6 3.00 -ssl.curves.X25519 6 3.00 -ssl.handshake 6 3.00 -ssl.session_reused 3 1.50 -ssl.sigalgs.rsa_pss_rsae_sha256 6 3.00 -ssl.versions.TLSv1.2 6 3.00 -upstream_cx_http1_total 6 3.00 -upstream_cx_rx_bytes_total 2702142 1351070.71 -upstream_cx_total 6 3.00 -upstream_cx_tx_bytes_total 3528 1764.00 -upstream_rq_pending_overflow 4 2.00 -upstream_rq_pending_total 6 3.00 -upstream_rq_total 56 28.00 - From 0711c155c7aecb62551718b7c60878fa41e4098b Mon Sep 17 00:00:00 2001 From: Otto van der Schaaf Date: Wed, 10 Jun 2020 19:37:39 +0200 Subject: [PATCH 3/3] Review feedback: better target tests Signed-off-by: Otto van der Schaaf --- test/BUILD | 4 +- test/output_formatter_test.cc | 4 +- test/test_data/large-sample.json | 1084 ----------------- .../test_data/output_formatter.large.txt.gold | 60 - .../test_data/percentile-column-overflow.json | 20 + .../percentile-column-overflow.txt.gold | 10 + 6 files changed, 34 insertions(+), 1148 deletions(-) delete mode 100644 test/test_data/large-sample.json delete mode 100644 test/test_data/output_formatter.large.txt.gold create mode 100644 test/test_data/percentile-column-overflow.json create mode 100644 test/test_data/percentile-column-overflow.txt.gold diff --git a/test/BUILD b/test/BUILD index 08591c7cc..91dfad7c2 100644 --- a/test/BUILD +++ b/test/BUILD @@ -99,14 +99,14 @@ envoy_cc_test( name = "output_formatter_test", srcs = ["output_formatter_test.cc"], data = [ - "test_data/large-sample.json", "test_data/output_formatter.dotted.gold", "test_data/output_formatter.json.gold", - "test_data/output_formatter.large.txt.gold", "test_data/output_formatter.medium.fortio.gold", "test_data/output_formatter.medium.proto.gold", "test_data/output_formatter.txt.gold", "test_data/output_formatter.yaml.gold", + "test_data/percentile-column-overflow.json", + "test_data/percentile-column-overflow.txt.gold", ], repository = "@envoy", deps = [ diff --git a/test/output_formatter_test.cc b/test/output_formatter_test.cc index cdea8cb14..3ba9cad23 100644 --- a/test/output_formatter_test.cc +++ b/test/output_formatter_test.cc @@ -193,10 +193,10 @@ TEST_F(MediumOutputCollectorTest, FortioFormatter) { } TEST_F(MediumOutputCollectorTest, ConsoleOutputFormatter) { - const auto input_proto = loadProtoFromFile("test/test_data/large-sample.json"); + const auto input_proto = loadProtoFromFile("test/test_data/percentile-column-overflow.json"); ConsoleOutputFormatterImpl formatter; expectEqualToGoldFile(formatter.formatProto(input_proto), - "test/test_data/output_formatter.large.txt.gold"); + "test/test_data/percentile-column-overflow.txt.gold"); } class StatidToNameTest : public Test {}; diff --git a/test/test_data/large-sample.json b/test/test_data/large-sample.json deleted file mode 100644 index 6618136da..000000000 --- a/test/test_data/large-sample.json +++ /dev/null @@ -1,1084 +0,0 @@ -{ - "options": { - "verbosity": { - "value": "INFO" - }, - "output_format": { - "value": "JSON" - }, - "address_family": { - "value": "AUTO" - }, - "request_options": { - "request_method": "GET", - "request_headers": [] - }, - "tls_context": { - "sni": "", - "allow_renegotiation": false - }, - "sequencer_idle_strategy": { - "value": "SPIN" - }, - "experimental_h1_connection_reuse_strategy": { - "value": "MRU" - }, - "termination_predicates": {}, - "failure_predicates": { - "benchmark.http_5xx": "0", - "requestsource.upstream_rq_5xx": "0", - "benchmark.pool_connection_failure": "0", - "benchmark.http_4xx": "0" - }, - "labels": [], - "requests_per_second": 2000, - "connections": 100, - "duration": "5s", - "timeout": "30s", - "h2": false, - "concurrency": "1", - "prefetch_connections": false, - "burst_size": 0, - "max_pending_requests": 0, - "max_active_requests": 100, - "max_requests_per_connection": 4294937295, - "uri": "www.we-amp.com", - "trace": "", - "open_loop": true, - "experimental_h2_use_multiple_connections": false, - "nighthawk_service": "", - "simple_warmup": false - }, - "results": [ - { - "name": "global", - "statistics": [ - { - "count": "1368", - "id": "benchmark_http_client.queue_to_connect", - "percentiles": [ - { - "percentile": 0, - "count": "1", - "duration": "0.000055253s" - }, - { - "percentile": 0.1, - "count": "137", - "duration": "0.000067983s" - }, - { - "percentile": 0.2, - "count": "274", - "duration": "0.000068599s" - }, - { - "percentile": 0.3, - "count": "412", - "duration": "0.000069107s" - }, - { - "percentile": 0.4, - "count": "548", - "duration": "0.000069731s" - }, - { - "percentile": 0.5, - "count": "684", - "duration": "0.000070499s" - }, - { - "percentile": 0.55, - "count": "753", - "duration": "0.000070903s" - }, - { - "percentile": 0.6, - "count": "821", - "duration": "0.000071807s" - }, - { - "percentile": 0.65, - "count": "890", - "duration": "0.000084791s" - }, - { - "percentile": 0.7, - "count": "958", - "duration": "0.000720063s" - }, - { - "percentile": 0.75, - "count": "1026", - "duration": "0.001486591s" - }, - { - "percentile": 0.775, - "count": "1061", - "duration": "0.002796159s" - }, - { - "percentile": 0.8, - "count": "1095", - "duration": "0.003707007s" - }, - { - "percentile": 0.825, - "count": "1129", - "duration": "0.004838399s" - }, - { - "percentile": 0.85, - "count": "1163", - "duration": "0.005854975s" - }, - { - "percentile": 0.875, - "count": "1197", - "duration": "0.007474431s" - }, - { - "percentile": 0.8875, - "count": "1215", - "duration": "0.008835071s" - }, - { - "percentile": 0.9, - "count": "1232", - "duration": "0.009914367s" - }, - { - "percentile": 0.9125, - "count": "1249", - "duration": "0.011802111s" - }, - { - "percentile": 0.925, - "count": "1266", - "duration": "0.013372927s" - }, - { - "percentile": 0.9375, - "count": "1283", - "duration": "0.015265279s" - }, - { - "percentile": 0.94375, - "count": "1292", - "duration": "0.017459199s" - }, - { - "percentile": 0.95, - "count": "1300", - "duration": "0.018770943s" - }, - { - "percentile": 0.95625, - "count": "1309", - "duration": "0.020772863s" - }, - { - "percentile": 0.9625, - "count": "1317", - "duration": "0.022490111s" - }, - { - "percentile": 0.96875, - "count": "1326", - "duration": "0.025802751s" - }, - { - "percentile": 0.971875, - "count": "1330", - "duration": "0.026951679s" - }, - { - "percentile": 0.975, - "count": "1334", - "duration": "0.028279807s" - }, - { - "percentile": 0.978125, - "count": "1339", - "duration": "0.031925247s" - }, - { - "percentile": 0.98125, - "count": "1343", - "duration": "0.035825663s" - }, - { - "percentile": 0.984375, - "count": "1347", - "duration": "0.038993919s" - }, - { - "percentile": 0.9859375, - "count": "1349", - "duration": "0.041373695s" - }, - { - "percentile": 0.9875, - "count": "1351", - "duration": "0.043419647s" - }, - { - "percentile": 0.9890625, - "count": "1354", - "duration": "0.053880831s" - }, - { - "percentile": 0.990625, - "count": "1356", - "duration": "0.059416575s" - }, - { - "percentile": 0.9921875, - "count": "1358", - "duration": "0.065710079s" - }, - { - "percentile": 0.99296875, - "count": "1359", - "duration": "0.067395583s" - }, - { - "percentile": 0.99375, - "count": "1360", - "duration": "0.075341823s" - }, - { - "percentile": 0.99453125, - "count": "1361", - "duration": "0.077434879s" - }, - { - "percentile": 0.9953125, - "count": "1362", - "duration": "0.080871423s" - }, - { - "percentile": 0.99609375, - "count": "1363", - "duration": "0.085630975s" - }, - { - "percentile": 0.996484375, - "count": "1364", - "duration": "0.091783167s" - }, - { - "percentile": 0.996875, - "count": "1364", - "duration": "0.091783167s" - }, - { - "percentile": 0.997265625, - "count": "1365", - "duration": "0.091828223s" - }, - { - "percentile": 0.99765625, - "count": "1365", - "duration": "0.091828223s" - }, - { - "percentile": 0.998046875, - "count": "1366", - "duration": "0.093204479s" - }, - { - "percentile": 0.9982421875, - "count": "1366", - "duration": "0.093204479s" - }, - { - "percentile": 0.9984375, - "count": "1366", - "duration": "0.093204479s" - }, - { - "percentile": 0.9986328125, - "count": "1367", - "duration": "0.093671423s" - }, - { - "percentile": 0.998828125, - "count": "1367", - "duration": "0.093671423s" - }, - { - "percentile": 0.9990234375, - "count": "1367", - "duration": "0.093671423s" - }, - { - "percentile": 0.99912109375, - "count": "1367", - "duration": "0.093671423s" - }, - { - "percentile": 0.99921875, - "count": "1367", - "duration": "0.093671423s" - }, - { - "percentile": 0.99931640625, - "count": "1368", - "duration": "0.094236671s" - }, - { - "percentile": 1, - "count": "1368", - "duration": "0.094236671s" - } - ], - "mean": "0.003489878s", - "pstdev": "0.010093363s", - "min": "0.000055253s", - "max": "0.094236671s" - }, - { - "count": "1317", - "id": "benchmark_http_client.request_to_response", - "percentiles": [ - { - "percentile": 0, - "count": "1", - "duration": "0.085323775s" - }, - { - "percentile": 0.1, - "count": "132", - "duration": "0.089104383s" - }, - { - "percentile": 0.2, - "count": "266", - "duration": "0.090038271s" - }, - { - "percentile": 0.3, - "count": "396", - "duration": "0.091021311s" - }, - { - "percentile": 0.4, - "count": "527", - "duration": "0.091930623s" - }, - { - "percentile": 0.5, - "count": "659", - "duration": "0.092962815s" - }, - { - "percentile": 0.55, - "count": "726", - "duration": "0.093470719s" - }, - { - "percentile": 0.6, - "count": "792", - "duration": "0.093925375s" - }, - { - "percentile": 0.65, - "count": "857", - "duration": "0.094400511s" - }, - { - "percentile": 0.7, - "count": "923", - "duration": "0.094887935s" - }, - { - "percentile": 0.75, - "count": "988", - "duration": "0.095383551s" - }, - { - "percentile": 0.775, - "count": "1021", - "duration": "0.095690751s" - }, - { - "percentile": 0.8, - "count": "1054", - "duration": "0.095977471s" - }, - { - "percentile": 0.825, - "count": "1087", - "duration": "0.096333823s" - }, - { - "percentile": 0.85, - "count": "1120", - "duration": "0.096927743s" - }, - { - "percentile": 0.875, - "count": "1153", - "duration": "0.097488895s" - }, - { - "percentile": 0.8875, - "count": "1169", - "duration": "0.097800191s" - }, - { - "percentile": 0.9, - "count": "1186", - "duration": "0.098242559s" - }, - { - "percentile": 0.9125, - "count": "1203", - "duration": "0.099246079s" - }, - { - "percentile": 0.925, - "count": "1219", - "duration": "0.100515839s" - }, - { - "percentile": 0.9375, - "count": "1235", - "duration": "0.101728255s" - }, - { - "percentile": 0.94375, - "count": "1243", - "duration": "0.101879807s" - }, - { - "percentile": 0.95, - "count": "1252", - "duration": "0.102346751s" - }, - { - "percentile": 0.95625, - "count": "1260", - "duration": "0.102588415s" - }, - { - "percentile": 0.9625, - "count": "1268", - "duration": "0.103333887s" - }, - { - "percentile": 0.96875, - "count": "1276", - "duration": "0.103792639s" - }, - { - "percentile": 0.971875, - "count": "1280", - "duration": "0.104132607s" - }, - { - "percentile": 0.975, - "count": "1286", - "duration": "0.104755199s" - }, - { - "percentile": 0.978125, - "count": "1289", - "duration": "0.105213951s" - }, - { - "percentile": 0.98125, - "count": "1293", - "duration": "0.105852927s" - }, - { - "percentile": 0.984375, - "count": "1297", - "duration": "0.106606591s" - }, - { - "percentile": 0.9859375, - "count": "1299", - "duration": "0.107266047s" - }, - { - "percentile": 0.9875, - "count": "1301", - "duration": "0.107794431s" - }, - { - "percentile": 0.9890625, - "count": "1303", - "duration": "0.108445695s" - }, - { - "percentile": 0.990625, - "count": "1305", - "duration": "0.109101055s" - }, - { - "percentile": 0.9921875, - "count": "1307", - "duration": "0.109215743s" - }, - { - "percentile": 0.99296875, - "count": "1308", - "duration": "0.109264895s" - }, - { - "percentile": 0.99375, - "count": "1309", - "duration": "0.109727743s" - }, - { - "percentile": 0.99453125, - "count": "1310", - "duration": "0.109748223s" - }, - { - "percentile": 0.9953125, - "count": "1311", - "duration": "0.109780991s" - }, - { - "percentile": 0.99609375, - "count": "1312", - "duration": "0.109879295s" - }, - { - "percentile": 0.996484375, - "count": "1313", - "duration": "0.110555135s" - }, - { - "percentile": 0.996875, - "count": "1313", - "duration": "0.110555135s" - }, - { - "percentile": 0.997265625, - "count": "1314", - "duration": "0.110731263s" - }, - { - "percentile": 0.99765625, - "count": "1314", - "duration": "0.110731263s" - }, - { - "percentile": 0.998046875, - "count": "1315", - "duration": "0.110784511s" - }, - { - "percentile": 0.9982421875, - "count": "1315", - "duration": "0.110784511s" - }, - { - "percentile": 0.9984375, - "count": "1315", - "duration": "0.110784511s" - }, - { - "percentile": 0.9986328125, - "count": "1316", - "duration": "0.111198207s" - }, - { - "percentile": 0.998828125, - "count": "1316", - "duration": "0.111198207s" - }, - { - "percentile": 0.9990234375, - "count": "1316", - "duration": "0.111198207s" - }, - { - "percentile": 0.99912109375, - "count": "1316", - "duration": "0.111198207s" - }, - { - "percentile": 0.99921875, - "count": "1316", - "duration": "0.111198207s" - }, - { - "percentile": 0.99931640625, - "count": "1317", - "duration": "0.112316415s" - }, - { - "percentile": 1, - "count": "1317", - "duration": "0.112316415s" - } - ], - "mean": "0.093536335s", - "pstdev": "0.004224355s", - "min": "0.085323775s", - "max": "0.112316415s" - }, - { - "count": "1317", - "id": "benchmark_http_client.response_body_size", - "percentiles": [], - "raw_mean": 146, - "raw_pstdev": 0, - "raw_min": "146", - "raw_max": "146" - }, - { - "count": "1317", - "id": "benchmark_http_client.response_header_size", - "percentiles": [], - "raw_mean": 151, - "raw_pstdev": 0, - "raw_min": "151", - "raw_max": "151" - }, - { - "count": "0", - "id": "sequencer.blocking", - "percentiles": [ - { - "percentile": 1, - "count": "0", - "duration": "0s" - } - ], - "mean": "0s", - "pstdev": "0s", - "min": "0s", - "max": "0s" - }, - { - "count": "9948", - "id": "sequencer.callback", - "percentiles": [ - { - "percentile": 0, - "count": "1", - "duration": "0.000045675s" - }, - { - "percentile": 0.1, - "count": "995", - "duration": "0.000047861s" - }, - { - "percentile": 0.2, - "count": "1995", - "duration": "0.000048215s" - }, - { - "percentile": 0.3, - "count": "2989", - "duration": "0.000048569s" - }, - { - "percentile": 0.4, - "count": "3984", - "duration": "0.000048917s" - }, - { - "percentile": 0.5, - "count": "4975", - "duration": "0.000049209s" - }, - { - "percentile": 0.55, - "count": "5472", - "duration": "0.000049361s" - }, - { - "percentile": 0.6, - "count": "5969", - "duration": "0.000049553s" - }, - { - "percentile": 0.65, - "count": "6469", - "duration": "0.000049795s" - }, - { - "percentile": 0.7, - "count": "6967", - "duration": "0.000050303s" - }, - { - "percentile": 0.75, - "count": "7462", - "duration": "0.000051087s" - }, - { - "percentile": 0.775, - "count": "7710", - "duration": "0.000051541s" - }, - { - "percentile": 0.8, - "count": "7959", - "duration": "0.000052147s" - }, - { - "percentile": 0.825, - "count": "8208", - "duration": "0.000059921s" - }, - { - "percentile": 0.85, - "count": "8456", - "duration": "0.000062641s" - }, - { - "percentile": 0.875, - "count": "8705", - "duration": "0.089055231s" - }, - { - "percentile": 0.8875, - "count": "8829", - "duration": "0.090411007s" - }, - { - "percentile": 0.9, - "count": "8955", - "duration": "0.091602943s" - }, - { - "percentile": 0.9125, - "count": "9078", - "duration": "0.092766207s" - }, - { - "percentile": 0.925, - "count": "9202", - "duration": "0.093822975s" - }, - { - "percentile": 0.9375, - "count": "9327", - "duration": "0.094846975s" - }, - { - "percentile": 0.94375, - "count": "9389", - "duration": "0.095350783s" - }, - { - "percentile": 0.95, - "count": "9451", - "duration": "0.095879167s" - }, - { - "percentile": 0.95625, - "count": "9513", - "duration": "0.096555007s" - }, - { - "percentile": 0.9625, - "count": "9575", - "duration": "0.097349631s" - }, - { - "percentile": 0.96875, - "count": "9638", - "duration": "0.098549759s" - }, - { - "percentile": 0.971875, - "count": "9669", - "duration": "0.099536895s" - }, - { - "percentile": 0.975, - "count": "9700", - "duration": "0.100904959s" - }, - { - "percentile": 0.978125, - "count": "9732", - "duration": "0.102014975s" - }, - { - "percentile": 0.98125, - "count": "9762", - "duration": "0.103227391s" - }, - { - "percentile": 0.984375, - "count": "9793", - "duration": "0.105037823s" - }, - { - "percentile": 0.9859375, - "count": "9809", - "duration": "0.106287103s" - }, - { - "percentile": 0.9875, - "count": "9824", - "duration": "0.107143167s" - }, - { - "percentile": 0.9890625, - "count": "9840", - "duration": "0.108556287s" - }, - { - "percentile": 0.990625, - "count": "9855", - "duration": "0.109854719s" - }, - { - "percentile": 0.9921875, - "count": "9871", - "duration": "0.112148479s" - }, - { - "percentile": 0.99296875, - "count": "9879", - "duration": "0.112934911s" - }, - { - "percentile": 0.99375, - "count": "9886", - "duration": "0.113938431s" - }, - { - "percentile": 0.99453125, - "count": "9894", - "duration": "0.114872319s" - }, - { - "percentile": 0.9953125, - "count": "9902", - "duration": "0.116215807s" - }, - { - "percentile": 0.99609375, - "count": "9910", - "duration": "0.118276095s" - }, - { - "percentile": 0.996484375, - "count": "9914", - "duration": "0.121716735s" - }, - { - "percentile": 0.996875, - "count": "9917", - "duration": "0.123699199s" - }, - { - "percentile": 0.997265625, - "count": "9921", - "duration": "0.125431807s" - }, - { - "percentile": 0.99765625, - "count": "9925", - "duration": "0.130064383s" - }, - { - "percentile": 0.998046875, - "count": "9929", - "duration": "0.133173247s" - }, - { - "percentile": 0.9982421875, - "count": "9931", - "duration": "0.136265727s" - }, - { - "percentile": 0.9984375, - "count": "9933", - "duration": "0.141279231s" - }, - { - "percentile": 0.9986328125, - "count": "9935", - "duration": "0.150364159s" - }, - { - "percentile": 0.998828125, - "count": "9937", - "duration": "0.155402239s" - }, - { - "percentile": 0.9990234375, - "count": "9939", - "duration": "0.160137215s" - }, - { - "percentile": 0.99912109375, - "count": "9940", - "duration": "0.163037183s" - }, - { - "percentile": 0.99921875, - "count": "9941", - "duration": "0.171376639s" - }, - { - "percentile": 0.99931640625, - "count": "9942", - "duration": "0.175144959s" - }, - { - "percentile": 0.9994140625, - "count": "9943", - "duration": "0.181329919s" - }, - { - "percentile": 0.99951171875, - "count": "9944", - "duration": "0.181829631s" - }, - { - "percentile": 0.999560546875, - "count": "9944", - "duration": "0.181829631s" - }, - { - "percentile": 0.999609375, - "count": "9945", - "duration": "0.185434111s" - }, - { - "percentile": 0.999658203125, - "count": "9945", - "duration": "0.185434111s" - }, - { - "percentile": 0.99970703125, - "count": "9946", - "duration": "0.190472191s" - }, - { - "percentile": 0.999755859375, - "count": "9946", - "duration": "0.190472191s" - }, - { - "percentile": 0.9997802734375, - "count": "9946", - "duration": "0.190472191s" - }, - { - "percentile": 0.9998046875, - "count": "9947", - "duration": "0.192315391s" - }, - { - "percentile": 0.9998291015625, - "count": "9947", - "duration": "0.192315391s" - }, - { - "percentile": 0.999853515625, - "count": "9947", - "duration": "0.192315391s" - }, - { - "percentile": 0.9998779296875, - "count": "9947", - "duration": "0.192315391s" - }, - { - "percentile": 0.99989013671875, - "count": "9947", - "duration": "0.192315391s" - }, - { - "percentile": 0.99990234375, - "count": "9948", - "duration": "0.194347007s" - }, - { - "percentile": 1, - "count": "9948", - "duration": "0.194347007s" - } - ], - "mean": "0.012904538s", - "pstdev": "0.033144393s", - "min": "0.000045675s", - "max": "0.194347007s" - } - ], - "counters": [ - { - "name": "benchmark.http_3xx", - "value": "1317" - }, - { - "name": "benchmark.pool_overflow", - "value": "8631" - }, - { - "name": "cluster_manager.cluster_added", - "value": "1" - }, - { - "name": "default.total_match_count", - "value": "1" - }, - { - "name": "membership_change", - "value": "1" - }, - { - "name": "runtime.load_success", - "value": "1" - }, - { - "name": "runtime.override_dir_not_exists", - "value": "1" - }, - { - "name": "upstream_cx_http1_total", - "value": "52" - }, - { - "name": "upstream_cx_rx_bytes_total", - "value": "449097" - }, - { - "name": "upstream_cx_total", - "value": "52" - }, - { - "name": "upstream_cx_tx_bytes_total", - "value": "84816" - }, - { - "name": "upstream_rq_pending_overflow", - "value": "8631" - }, - { - "name": "upstream_rq_pending_total", - "value": "451" - }, - { - "name": "upstream_rq_total", - "value": "1368" - } - ], - "execution_duration": "5.000010451s" - } - ], - "version": { - "version": { - "major_number": 0, - "minor_number": 3, - "patch": 0 - } - }, - "timestamp": "2020-06-10T09:47:06.915922617Z" -} diff --git a/test/test_data/output_formatter.large.txt.gold b/test/test_data/output_formatter.large.txt.gold deleted file mode 100644 index 9bcc9a942..000000000 --- a/test/test_data/output_formatter.large.txt.gold +++ /dev/null @@ -1,60 +0,0 @@ -Nighthawk - A layer 7 protocol benchmarking tool. - -Queueing and connection setup latency (1368 samples) - min: 0s 000ms 055us | mean: 0s 003ms 489us | max: 0s 094ms 236us | pstdev: 0s 010ms 093us - - Percentile Count Value - 0.5 684 0s 000ms 070us - 0.75 1026 0s 001ms 486us - 0.8 1095 0s 003ms 707us - 0.9 1232 0s 009ms 914us - 0.95 1300 0s 018ms 770us - 0.990625 1356 0s 059ms 416us - 0.99902344 1367 0s 093ms 671us - -Request start to response end (1317 samples) - min: 0s 085ms 323us | mean: 0s 093ms 536us | max: 0s 112ms 316us | pstdev: 0s 004ms 224us - - Percentile Count Value - 0.5 659 0s 092ms 962us - 0.75 988 0s 095ms 383us - 0.8 1054 0s 095ms 977us - 0.9 1186 0s 098ms 242us - 0.95 1252 0s 102ms 346us - 0.990625 1305 0s 109ms 101us - 0.99902344 1316 0s 111ms 198us - -Response body size in bytes (1317 samples) - min: 146 | mean: 146.0 | max: 146 | pstdev: 0.0 - -Response header size in bytes (1317 samples) - min: 151 | mean: 151.0 | max: 151 | pstdev: 0.0 - -Initiation to completion (9948 samples) - min: 0s 000ms 045us | mean: 0s 012ms 904us | max: 0s 194ms 347us | pstdev: 0s 033ms 144us - - Percentile Count Value - 0.5 4975 0s 000ms 049us - 0.75 7462 0s 000ms 051us - 0.8 7959 0s 000ms 052us - 0.9 8955 0s 091ms 602us - 0.95 9451 0s 095ms 879us - 0.990625 9855 0s 109ms 854us - 0.99902344 9939 0s 160ms 137us - -Counter Value Per second -benchmark.http_3xx 1317 263.40 -benchmark.pool_overflow 8631 1726.20 -cluster_manager.cluster_added 1 0.20 -default.total_match_count 1 0.20 -membership_change 1 0.20 -runtime.load_success 1 0.20 -runtime.override_dir_not_exists 1 0.20 -upstream_cx_http1_total 52 10.40 -upstream_cx_rx_bytes_total 449097 89819.21 -upstream_cx_total 52 10.40 -upstream_cx_tx_bytes_total 84816 16963.16 -upstream_rq_pending_overflow 8631 1726.20 -upstream_rq_pending_total 451 90.20 -upstream_rq_total 1368 273.60 - diff --git a/test/test_data/percentile-column-overflow.json b/test/test_data/percentile-column-overflow.json new file mode 100644 index 000000000..fa4dcbcdd --- /dev/null +++ b/test/test_data/percentile-column-overflow.json @@ -0,0 +1,20 @@ +{ + "results": [ + { + "name": "global", + "statistics": [ + { + "count": "1", + "id": "foo", + "percentiles": [ + { + "percentile": 0.99931640625, + "count": "1", + "duration": "0s" + } + ] + } + ] + } + ] +} diff --git a/test/test_data/percentile-column-overflow.txt.gold b/test/test_data/percentile-column-overflow.txt.gold new file mode 100644 index 000000000..8e57fbe71 --- /dev/null +++ b/test/test_data/percentile-column-overflow.txt.gold @@ -0,0 +1,10 @@ +Nighthawk - A layer 7 protocol benchmarking tool. + +foo (1 samples) + min: 0 | mean: 0.0 | max: 0 | pstdev: 0.0 + + Percentile Count Value + 0.99931641 1 0s 000ms 000us + +Counter Value Per second +