Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
2f4036f
Initial work on Fortio Output Format
nareddyt Oct 18, 2019
2379f61
Add basic fortio proto
nareddyt Oct 18, 2019
88c6812
Add some more fields
nareddyt Oct 18, 2019
661038b
Remove unneeded import
nareddyt Oct 18, 2019
07a6c7f
Disable validation
nareddyt Oct 18, 2019
9abb017
More fields
nareddyt Oct 18, 2019
f39f726
More fields
nareddyt Oct 18, 2019
3336bf3
Fix nullptr
nareddyt Oct 18, 2019
79f023a
Fill in all the top-level fields and verified output is correct
nareddyt Oct 18, 2019
ff250a9
Delete some data that is not used anymore
nareddyt Oct 18, 2019
eaeca56
Fix insertion + exception
nareddyt Oct 18, 2019
2c19e11
Remove some more fields that are not needed
nareddyt Oct 18, 2019
a3b864d
Cleanup
nareddyt Oct 18, 2019
372a0fe
Start working on DurationHistogram
nareddyt Oct 18, 2019
c526b9c
Mapping of all fields
nareddyt Oct 18, 2019
68f3690
Remove first entry from the dataset to make the graph look nicer
nareddyt Oct 18, 2019
40b01c0
Some test data (temporary)
nareddyt Oct 18, 2019
f3cb825
Better test data
nareddyt Oct 18, 2019
b95cf4e
Fix format
nareddyt Oct 18, 2019
0dca025
Fix tests and docs
nareddyt Oct 18, 2019
6a52796
Fix initial sample
nareddyt Oct 18, 2019
a676086
Review comments
nareddyt Oct 22, 2019
4b73fa6
Move fortio proto to ./transform
nareddyt Oct 22, 2019
41838fc
Add test for output formatter
nareddyt Oct 22, 2019
a53dd09
Fix format
nareddyt Oct 22, 2019
c189419
Remove old test data
nareddyt Oct 22, 2019
d210488
Add sample data
nareddyt Oct 22, 2019
6713813
Add docs
nareddyt Oct 22, 2019
48deaea
Remove test data yaml
nareddyt Oct 22, 2019
8550a86
Fix images
nareddyt Oct 22, 2019
4ad87c9
Review comments
nareddyt Oct 29, 2019
22ec3f5
Review comments #2
nareddyt Oct 29, 2019
932814f
Review comments 3
nareddyt Oct 29, 2019
ece7105
Merge branch 'master' into fortio-output-format
nareddyt Nov 8, 2019
9a5547a
Add comment about proto-json trick
nareddyt Nov 8, 2019
2ba9e57
Only wrap optional types
nareddyt Nov 8, 2019
fe97b6c
Fix README
nareddyt Nov 8, 2019
ef16f64
Fix readme
nareddyt Nov 8, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 30 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Nighthawk currently offers:
- A load testing client which supports HTTP/1.1 and HTTP/2 over HTTP and HTTPS.
(HTTPS certificates are not yet validated).
- A simple [test server](source/server/README.md) which is capable of generating dynamic response sizes, as well as inject delays.

- A binary to transform nighthawk output to well-known formats, allowing integration with other systems and dashboards.

## Prerequisites

Expand Down Expand Up @@ -55,12 +55,13 @@ bazel-bin/nighthawk_client [--trace <uri format>]
|CONNECT|OPTIONS|TRACE>] [--address-family
<auto|v4|v6>] [--burst-size <uint32_t>]
[--prefetch-connections] [--output-format
<json|human|yaml|dotted>] [-v <trace|debug
|info|warn|error|critical>] [--concurrency
<string>] [--h2] [--timeout <uint32_t>]
[--duration <uint32_t>] [--connections
<uint32_t>] [--rps <uint32_t>] [--]
[--version] [-h] <uri format>
<json|human|yaml|dotted|fortio>] [-v <trace
|debug|info|warn|error|critical>]
[--concurrency <string>] [--h2] [--timeout
<uint32_t>] [--duration <uint32_t>]
[--connections <uint32_t>] [--rps
<uint32_t>] [--] [--version] [-h] <uri
format>


Where:
Expand Down Expand Up @@ -111,9 +112,9 @@ Release requests in bursts of the specified size (default: 0).
--prefetch-connections
Prefetch connections before benchmarking (HTTP/1 only).

--output-format <json|human|yaml|dotted>
Output format. Possible values: {"json", "human", "yaml", "dotted"}.
The default output format is 'human'.
--output-format <json|human|yaml|dotted|fortio>
Output format. Possible values: {"json", "human", "yaml", "dotted",
"fortio"}. The default output format is 'human'.

-v <trace|debug|info|warn|error|critical>, --verbosity <trace|debug
|info|warn|error|critical>
Expand Down Expand Up @@ -208,14 +209,15 @@ Nighthawk comes with a tool to transform its json output to its other supported
USAGE:

bazel-bin/nighthawk_output_transform --output-format <json|human|yaml
|dotted> [--] [--version] [-h]
|dotted|fortio> [--] [--version]
[-h]


Where:

--output-format <json|human|yaml|dotted>
--output-format <json|human|yaml|dotted|fortio>
(required) Output format. Possible values: {"json", "human", "yaml",
"dotted"}.
"dotted", "fortio"}.

--, --ignore_rest
Ignores the rest of the labeled arguments following this flag.
Expand Down Expand Up @@ -305,6 +307,21 @@ client.upstream_rq_total 9994 1998.80
[21:28:18.522403][27849][I] [source/client/client.cc:279] Done.
```

## Visualizing the output of a benchmark

Nighthawk supports transforming the output into other well-known formats, such as:

- `dotted`: Provides integration with Prometheus
- `fortio`: Provides integration with [Fortio's report-only UI](https://github.com/fortio/fortio#report-only-ui)

The following is an example of a nighthawk benchmark visualized via the Fortio UI.

```bash
fortio report --data-dir ./samples/fortio_data
```

![Fortio Large Report](./samples/fortio_reports/large.png)

## Accuracy and repeatability considerations when using the Nighthawk client

- Processes not related to the benchmarking task at hand may add significant noise. Consider stopping any
Expand Down
1 change: 1 addition & 0 deletions api/client/options.proto
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ message OutputFormat {
HUMAN = 2;
YAML = 3;
DOTTED = 4;
FORTIO = 5;
}
OutputFormatOptions value = 1;
}
Expand Down
14 changes: 14 additions & 0 deletions api/client/transform/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
licenses(["notice"]) # Apache 2

load("@envoy//bazel:envoy_build_system.bzl", "envoy_package")
load("@envoy_api//bazel:api_build_system.bzl", "api_cc_py_proto_library")

envoy_package()

api_cc_py_proto_library(
name = "transform",
srcs = [
"fortio.proto",
],
visibility = ["//visibility:public"],
)
57 changes: 57 additions & 0 deletions api/client/transform/fortio.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
syntax = "proto3";

package nighthawk.client;

import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/wrappers.proto";
import "validate/validate.proto";

// This proto represents that output format that Fortio expects when converted to JSON.
// Nighthawk can fill in this proto, and then unmarshal to the Fortio-compatible JSON.
// Therefore, this proto may not follow conventions. aip.dev/not-precedent
message FortioResult {
// Disable validate because it doesn't work well with fields that are not all lowercase.
// The field cases must match the final output JSON that fortio-ui expects.
Comment thread
nareddyt marked this conversation as resolved.
option (validate.disabled) = true;

string Labels = 1;

google.protobuf.Timestamp StartTime = 2;

uint32 RequestedQPS = 3;

google.protobuf.Duration RequestedDuration = 4;

double ActualQPS = 5;

double ActualDuration = 6;

uint32 NumThreads = 7;

DurationHistogram DurationHistogram = 8;

map<string, uint64> RetCodes = 11;

string URL = 12;
}

message DurationHistogram {
option (validate.disabled) = true;

uint64 Count = 1;

repeated DataEntry Data = 2;
}

message DataEntry {
option (validate.disabled) = true;

double Start = 1;

double End = 2;

double Percent = 3;

uint64 Count = 4;
}
Loading