Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ bazel build -c opt //:nighthawk
➜ bazel-bin/nighthawk_client --help
```

<!-- BEGIN USAGE -->
```

USAGE:

bazel-bin/nighthawk_client [--latency-response-header-name <string>]
Expand Down Expand Up @@ -296,7 +298,9 @@ benchmark a single endpoint. For multiple endpoints, set


L7 (HTTP/HTTPS/HTTP2) performance characterization tool.

```
<!-- END USAGE -->

### Nighthawk gRPC service

Expand All @@ -307,7 +311,9 @@ The gRPC service can be used to start a server which is able to perform back-to-
➜ bazel-bin/nighthawk_service --help
```

<!-- BEGIN USAGE -->
```

USAGE:

bazel-bin/nighthawk_service [--service <traffic-generator-service
Expand Down Expand Up @@ -340,7 +346,9 @@ Displays usage information and exits.


L7 (HTTP/HTTPS/HTTP2) performance characterization tool.

```
<!-- END USAGE -->

### Nighthawk output transformation utility

Expand All @@ -351,7 +359,9 @@ Nighthawk comes with a tool to transform its json output to its other supported
➜ bazel-bin/nighthawk_output_transform --help
```

<!-- BEGIN USAGE -->
```

USAGE:

bazel-bin/nighthawk_output_transform --output-format <json|human|yaml
Expand All @@ -378,7 +388,9 @@ Displays usage information and exits.


L7 (HTTP/HTTPS/HTTP2) performance characterization transformation tool.

```
<!-- END USAGE -->

## A sample benchmark run

Expand Down
4 changes: 2 additions & 2 deletions bazel/repositories.bzl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

ENVOY_COMMIT = "a3ece14ce23228accf70d5d306499d0794080dab" # Nov 1st, 2021
ENVOY_SHA = "6b4ddf868a764173c9011fa9827e37b508f08a17b839bef3b8ce5b13028949d5"
ENVOY_COMMIT = "a5a4251492a38c512cea974d318ed77a3f2a7b0b" # Nov 8th, 2021
ENVOY_SHA = "c1d706cfe298a0fbb249e5de7bfceba3732c9f1bfdf0ace2d51f2b3b30b7ee8e"

HDR_HISTOGRAM_C_VERSION = "0.11.2" # October 12th, 2020
HDR_HISTOGRAM_C_SHA = "637f28b5f64de2e268131e4e34e6eef0b91cf5ff99167db447d9b2825eae6bad"
Expand Down
13 changes: 7 additions & 6 deletions source/client/process_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -453,10 +453,16 @@ bool ProcessImpl::runInternal(OutputCollector& collector, const UriPtr& tracing_
}
shutdown_ = false;

const Envoy::OptionsImpl::HotRestartVersionCb hot_restart_version_cb = [](bool) {
return "hot restart is disabled";
};
const Envoy::OptionsImpl envoy_options(
/* args = */ {"process_impl"}, hot_restart_version_cb, spdlog::level::info);
// Needs to happen as early as possible (before createWorkers()) in the instantiation to preempt
// the objects that require stats.
if (!options_.statsSinks().empty()) {
store_root_.setTagProducer(Envoy::Config::Utility::createTagProducer(bootstrap_));
store_root_.setTagProducer(
Envoy::Config::Utility::createTagProducer(bootstrap_, envoy_options.statsTags()));
}

createWorkers(number_of_workers_, scheduled_start);
Expand All @@ -470,11 +476,6 @@ bool ProcessImpl::runInternal(OutputCollector& collector, const UriPtr& tracing_
std::make_unique<Envoy::Extensions::TransportSockets::Tls::ContextManagerImpl>(
time_system_);

const Envoy::OptionsImpl::HotRestartVersionCb hot_restart_version_cb = [](bool) {
return "hot restart is disabled";
};
const Envoy::OptionsImpl envoy_options(
/* args = */ {"process_impl"}, hot_restart_version_cb, spdlog::level::info);
cluster_manager_factory_ = std::make_unique<ClusterManagerFactory>(
admin_, Envoy::Runtime::LoaderSingleton::get(), store_root_, tls_, dns_resolver,
*ssl_context_manager_, *dispatcher_, *local_info_, secret_manager_, validation_context_,
Expand Down
15 changes: 14 additions & 1 deletion source/server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,13 @@ same time.
➜ bazel-bin/nighthawk_test_server --help
```

<!-- BEGIN USAGE -->
```

USAGE:

bazel-bin/nighthawk_test_server [--enable-core-dump] [--socket-mode
bazel-bin/nighthawk_test_server [--stats-tag <string>] ...
[--enable-core-dump] [--socket-mode
<string>] [--socket-path <string>]
[--disable-extensions <string>]
[--cpuset-threads]
Expand Down Expand Up @@ -197,6 +200,14 @@ bazel-bin/nighthawk_test_server [--enable-core-dump] [--socket-mode

Where:

--stats-tag <string> (accepted multiple times)
This flag provides a universal tag for all stats generated by Envoy.
The format is ``tag:value``. Only alphanumeric values are allowed for
tag names. For tag values all characters are permitted except for '.'
(dot). This flag can be repeated multiple times to set multiple
universal tags. Multiple values for the same tag name are not
allowed.

--enable-core-dump
Enable core dumps

Expand Down Expand Up @@ -323,4 +334,6 @@ Displays usage information and exits.


envoy

```
<!-- END USAGE -->
3 changes: 0 additions & 3 deletions test/integration/test_integration_basics.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,6 @@ def test_h3_quic(quic_test_server_fixture):
"benchmark.http_2xx:24",
"--max-active-requests",
"1",
# TODO(mum4k): Envoy assumes this to be 100. Remove when fixed upstream.
"--max-concurrent-streams",
"100",
# Envoy doesn't support disabling certificate verification on Quic
# connections, so the host in our requests has to match the hostname in
# the leaf certificate.
Expand Down
63 changes: 59 additions & 4 deletions tools/update_cli_readme_documentation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
#!/usr/bin/env python3
"""Tool to automatically update README.md files that contain --help output of c++ TCLAP binaries."""
"""Tool to automatically update README.md files that contain --help output of c++ TCLAP binaries.

It runs the specified binary with the --help flag and replaces all content
between our usage markers in the specified readme.

The readme has to have the following edit markers:

Unrelated text.
<!-- BEGIN USAGE -->

Text to be replaced.

<!-- END USAGE -->
"""

import logging
import argparse
Expand All @@ -9,6 +22,34 @@
import sys
import subprocess

# The marker expected at the beginning of the text section that should be
# replaced.
_BEGIN_MARKER = "<!-- BEGIN USAGE -->"

# The marker expected at the end of the text section that should be
# replaced.
_END_MARKER = "<!-- END USAGE -->"

# Template used when creating a regex pattern that replaces text between the
# markers, if it is for the specified binary.
# Matches a string like:
# <!-- BEGIN USAGE -->
# ```
#
# USAGE:
#
# bazel-bin/nighthawk_test_server ...
#
# ```
# <!-- END USAGE -->
#
# Note ".*?" performs a non-greedy match, since some of our readme files contain
# multiple USAGE sections.
_REPLACEMENT_PATTERN_TEMPLATE = r"{begin_marker}[`\s]+USAGE:\s+{binary}.*?{end_marker}"

# Template used to construct the replacement.
_REPLACEMENT_TEMPLATE = "{begin_marker}\n```\n{cli_help_text}\n```\n{end_marker}"

if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Tool to update README.md CLI documentation.")
parser.add_argument(
Expand All @@ -35,13 +76,27 @@
process = subprocess.run([args.binary, "--help"], stdout=subprocess.PIPE, check=True)

# Avoid trailing spaces, as they introduce markdown linting errors.
cli_help = [s.strip() for s in process.stdout.decode().splitlines()]
cli_help_lines = [s.strip() for s in process.stdout.decode().splitlines()]
cli_help_text = str.join("\n", cli_help_lines)

target_path = pathlib.Path(readme_md_path)
with target_path.open("r", encoding="utf-8") as f:
original_contents = target_path.read_text(encoding="utf-8")
replaced = re.sub("\nUSAGE\\:[^.]*.*%s[^```]*" % args.binary, str.join("\n", cli_help),
original_contents)
replacement_pattern = _REPLACEMENT_PATTERN_TEMPLATE.format(begin_marker=_BEGIN_MARKER,
binary=args.binary,
end_marker=_END_MARKER)
match_pattern = f".*{replacement_pattern}.*"
if not re.match(match_pattern, original_contents, flags=re.DOTALL):
logging.error(
"The original content in /%s doesn't match our replacement pattern '%s'. "
"If the file has the expected markers, this is likely a bug in "
"update_cli_readme_documentation.py.", args.readme, match_pattern)
sys.exit(-1)

replacement = _REPLACEMENT_TEMPLATE.format(begin_marker=_BEGIN_MARKER,
cli_help_text=cli_help_text,
end_marker=_END_MARKER)
replaced = re.sub(replacement_pattern, replacement, original_contents, flags=re.DOTALL)
# Avoid check_format flagging "over-enthousiastic" whitespace
replaced = replaced.replace("... [", "... [")

Expand Down