-
Notifications
You must be signed in to change notification settings - Fork 89
Finalize emission and tracking of latencies in response headers #500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
dubious90
merged 42 commits into
envoyproxy:master
from
oschaaf:origin-timings-tracking-option
Sep 9, 2020
Merged
Changes from all commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
c226497
Save state on origin timeing
oschaaf c6697de
Merge remote-tracking branch 'upstream/master' into origin-timings
oschaaf 28e0d34
Fix clang-tidy, format, and test build
oschaaf 94ad984
Merge remote-tracking branch 'upstream/master' into origin-timings
oschaaf 933c589
stats naming
oschaaf a1691ec
Merge remote-tracking branch 'upstream/master' into origin-timings
oschaaf 740d0ca
Track request receipt deltas. Configure response header name.
oschaaf 1afe2f1
Save state before context switching
oschaaf ae0c08e
Merge remote-tracking branch 'upstream/master' into origin-timings
oschaaf 3487e19
Merge remote-tracking branch 'upstream/master' into origin-timings
oschaaf 1d1f03a
Fix format
oschaaf a9d99eb
Suppress clang-tidy on MUTABLE_CONSTRUCT_ON_FIRST_USE
oschaaf 0aa8630
Proper locking, add TODOs and doc comments.
oschaaf db01e40
Merge remote-tracking branch 'upstream/master' into origin-timings
oschaaf 5e48513
Small fixes
oschaaf d9569cb
Add unit test for StreamDecoder
oschaaf cf1170c
Review feedback
oschaaf 421feb8
check_format introduced proto comment issues. Add punctuation.
oschaaf af148ea
Merge remote-tracking branch 'upstream/master' into origin-timings
oschaaf e813e75
Review feedback
oschaaf 505495c
Save state on splitting out a separate extension and stopwatch
oschaaf 5405dc9
Merge remote-tracking branch 'upstream/master' into origin-timings
oschaaf d858b55
Small corrections
oschaaf 3cf32b8
Add threaded spam test for stopwatch. Add doc comments.
oschaaf 35aee47
clang-tidy: fix for loop
oschaaf 027c00f
Merge remote-tracking branch 'upstream/master' into origin-timings
oschaaf 70502e1
Review feedback: doc comments
oschaaf a55bbe7
Wire up proto option
oschaaf d199313
Wire up TCLAP, add OptionImpl tests, regen CLI docs.
oschaaf a16d8dd
Address clang-tidy nit, better CLI/proto option description.
oschaaf f3008d9
Build time-tracking extension into test sever. Add end-to-end test.
oschaaf 7774e2d
review feedback
oschaaf 937fd88
Merge branch 'origin-timings' into origin-timings-tracking-option
oschaaf 8152829
Fix clang-tidy nit.
oschaaf 64cb19c
Merge remote-tracking branch 'upstream/master' into origin-timings-tr…
oschaaf af60b8d
Replace stopwatch shared_ptr to unique_ptr
oschaaf 3996c65
Fix a few small nits & improve option description.
oschaaf 228934a
Merge remote-tracking branch 'upstream/master' into origin-timings-tr…
oschaaf 00b6861
Fix todo
oschaaf 68ed58a
Review feedback
oschaaf 74f9717
Merge remote-tracking branch 'upstream/master' into origin-timings-tr…
oschaaf 594bbbe
Review feedback: option rename
oschaaf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
test/integration/configurations/nighthawk_track_timings.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # Envoy configuration template for testing the time-tracking http filter extension. | ||
| # Sets up the time-tracking extension plus the test-server extension for generating | ||
| # responses. | ||
| admin: | ||
| access_log_path: $tmpdir/nighthawk-test-server-admin-access.log | ||
| profile_path: $tmpdir/nighthawk-test-server.prof | ||
| address: | ||
| socket_address: { address: $server_ip, port_value: 0 } | ||
| static_resources: | ||
| listeners: | ||
| - address: | ||
| socket_address: | ||
| address: $server_ip | ||
| port_value: 0 | ||
| filter_chains: | ||
| - filters: | ||
| - name: envoy.http_connection_manager | ||
| config: | ||
| generate_request_id: false | ||
| codec_type: auto | ||
| stat_prefix: ingress_http | ||
| route_config: | ||
| name: local_route | ||
| virtual_hosts: | ||
| - name: service | ||
| domains: | ||
| - "*" | ||
| http_filters: | ||
| # Here we set up the time-tracking extension to emit request-arrival delta timings in a response header. | ||
| - name: time-tracking | ||
| config: | ||
| emit_previous_request_delta_in_response_header: x-origin-request-receipt-delta | ||
| - name: test-server | ||
| config: | ||
| response_body_size: 10 | ||
| - name: envoy.router | ||
| config: | ||
| dynamic_stats: false | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -700,6 +700,30 @@ def test_cancellation_with_infinite_duration(http_test_server_fixture): | |
| asserts.assertCounterGreaterEqual(counters, "benchmark.http_2xx", 1) | ||
|
|
||
|
|
||
| @pytest.mark.parametrize('server_config', [ | ||
| "nighthawk/test/integration/configurations/nighthawk_http_origin.yaml", | ||
| "nighthawk/test/integration/configurations/nighthawk_track_timings.yaml" | ||
| ]) | ||
| def test_http_h1_response_header_latency_tracking(http_test_server_fixture, server_config): | ||
| """Test emission and tracking of response header latencies. | ||
|
|
||
| Run the CLI configured to track latencies delivered by response header from the test-server. | ||
| Ensure that the origin_latency_statistic histogram receives the correct number of inputs. | ||
| """ | ||
| parsed_json, _ = http_test_server_fixture.runNighthawkClient([ | ||
| http_test_server_fixture.getTestServerRootUri(), "--connections", "1", "--rps", "100", | ||
| "--duration", "100", "--termination-predicate", "benchmark.http_2xx:99", | ||
| "--latency-response-header-name", "x-origin-request-receipt-delta" | ||
| ]) | ||
| global_histograms = http_test_server_fixture.getNighthawkGlobalHistogramsbyIdFromJson(parsed_json) | ||
| asserts.assertEqual(int(global_histograms["benchmark_http_client.latency_2xx"]["count"]), 100) | ||
| # Verify behavior is correct both with and without the timing filter enabled. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a very helpful comment here. Thanks |
||
| expected_histogram_count = 99 if "nighthawk_track_timings.yaml" in server_config else 0 | ||
| asserts.assertEqual( | ||
| int(global_histograms["benchmark_http_client.origin_latency_statistic"]["count"]), | ||
| expected_histogram_count) | ||
|
|
||
|
|
||
| def _run_client_with_args(args): | ||
| return utility.run_binary_with_args("nighthawk_client", args) | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a comment at the top of this, explaining its purpose in just a sentence, and draw attention to the relevant/unique part of the configuration (which I think is the time-tracking filter)