diff --git a/README.md b/README.md index cd0ea6126..453127805 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,9 @@ bazel build -c opt //:nighthawk ➜ bazel-bin/nighthawk_client --help ``` + ``` + USAGE: bazel-bin/nighthawk_client [--latency-response-header-name ] @@ -296,7 +298,9 @@ benchmark a single endpoint. For multiple endpoints, set L7 (HTTP/HTTPS/HTTP2) performance characterization tool. + ``` + ### Nighthawk gRPC service @@ -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 ``` + ``` + USAGE: bazel-bin/nighthawk_service [--service ### Nighthawk output transformation utility @@ -351,7 +359,9 @@ Nighthawk comes with a tool to transform its json output to its other supported ➜ bazel-bin/nighthawk_output_transform --help ``` + ``` + USAGE: bazel-bin/nighthawk_output_transform --output-format ## A sample benchmark run diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl index 0fde2b5f8..1f2087dd3 100644 --- a/bazel/repositories.bzl +++ b/bazel/repositories.bzl @@ -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" diff --git a/source/client/process_impl.cc b/source/client/process_impl.cc index dfe22ded3..f07e7f235 100644 --- a/source/client/process_impl.cc +++ b/source/client/process_impl.cc @@ -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); @@ -470,11 +476,6 @@ bool ProcessImpl::runInternal(OutputCollector& collector, const UriPtr& tracing_ std::make_unique( 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( admin_, Envoy::Runtime::LoaderSingleton::get(), store_root_, tls_, dns_resolver, *ssl_context_manager_, *dispatcher_, *local_info_, secret_manager_, validation_context_, diff --git a/source/server/README.md b/source/server/README.md index 20dfab3d3..1eb05b14c 100644 --- a/source/server/README.md +++ b/source/server/README.md @@ -160,10 +160,13 @@ same time. ➜ bazel-bin/nighthawk_test_server --help ``` + ``` + USAGE: -bazel-bin/nighthawk_test_server [--enable-core-dump] [--socket-mode +bazel-bin/nighthawk_test_server [--stats-tag ] ... +[--enable-core-dump] [--socket-mode ] [--socket-path ] [--disable-extensions ] [--cpuset-threads] @@ -197,6 +200,14 @@ bazel-bin/nighthawk_test_server [--enable-core-dump] [--socket-mode Where: +--stats-tag (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 @@ -323,4 +334,6 @@ Displays usage information and exits. envoy + ``` + diff --git a/test/integration/test_integration_basics.py b/test/integration/test_integration_basics.py index d6303046e..8f33ef92f 100644 --- a/test/integration/test_integration_basics.py +++ b/test/integration/test_integration_basics.py @@ -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. diff --git a/tools/update_cli_readme_documentation.py b/tools/update_cli_readme_documentation.py index 02f460ed9..17ef1ddc1 100644 --- a/tools/update_cli_readme_documentation.py +++ b/tools/update_cli_readme_documentation.py @@ -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. + + +Text to be replaced. + + +""" import logging import argparse @@ -9,6 +22,34 @@ import sys import subprocess +# The marker expected at the beginning of the text section that should be +# replaced. +_BEGIN_MARKER = "" + +# The marker expected at the end of the text section that should be +# replaced. +_END_MARKER = "" + +# Template used when creating a regex pattern that replaces text between the +# markers, if it is for the specified binary. +# Matches a string like: +# +# ``` +# +# USAGE: +# +# bazel-bin/nighthawk_test_server ... +# +# ``` +# +# +# 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( @@ -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("... [", "... [")