Update GraphQL tests to take a memory dump when not shutting down#2655
Merged
Conversation
Member
Author
Code Coverage Report 📊✔️ Merging #2655 into master will not change line coverage
View the full report for further details: Datadog.Trace Breakdown ✔️
The following classes have significant coverage changes.
View the full reports for further details: |
Member
Author
Benchmarks Report 🐌Benchmarks for #2655 compared to master:
The following thresholds were used for comparing the benchmark speeds:
Allocation changes below 0.5% are ignored. Benchmark detailsBenchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.AppSecBodyBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.AspNetCoreBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.GraphQLBenchmark - Faster 🎉 Same allocations ✔️
|
| Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
|---|---|---|---|---|
| Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync‑netcoreapp3.1 | 1.231 | 2,468.75 | 2,005.32 |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | ExecuteAsync |
net472 | 3.29μs | 11.9ns | 44.5ns | 0.168 | 0.00163 | 0 | 1.06 KB |
| master | ExecuteAsync |
netcoreapp3.1 | 2.47μs | 9.34ns | 33.7ns | 0.0135 | 0 | 0 | 1.03 KB |
| #2655 | ExecuteAsync |
net472 | 3.33μs | 13.3ns | 53.3ns | 0.167 | 0.00171 | 0 | 1.06 KB |
| #2655 | ExecuteAsync |
netcoreapp3.1 | 2μs | 4.75ns | 16.4ns | 0.0146 | 0 | 0 | 1.03 KB |
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | SendAsync |
net472 | 7.47μs | 42.7ns | 331ns | 0.354 | 0 | 0 | 2.28 KB |
| master | SendAsync |
netcoreapp3.1 | 5.1μs | 25.2ns | 104ns | 0.0303 | 0 | 0 | 2.21 KB |
| #2655 | SendAsync |
net472 | 7.26μs | 33.8ns | 135ns | 0.361 | 0 | 0 | 2.28 KB |
| #2655 | SendAsync |
netcoreapp3.1 | 5.66μs | 32.8ns | 279ns | 0.0296 | 0 | 0 | 2.21 KB |
Benchmarks.Trace.ILoggerBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | EnrichedLog |
net472 | 3.54μs | 18.1ns | 78.7ns | 0.228 | 0 | 0 | 1.45 KB |
| master | EnrichedLog |
netcoreapp3.1 | 3.41μs | 18.6ns | 102ns | 0.0204 | 0 | 0 | 1.53 KB |
| #2655 | EnrichedLog |
net472 | 3.74μs | 21.5ns | 184ns | 0.227 | 0 | 0 | 1.45 KB |
| #2655 | EnrichedLog |
netcoreapp3.1 | 3.19μs | 7.67ns | 28.7ns | 0.0208 | 0 | 0 | 1.53 KB |
Benchmarks.Trace.Log4netBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | EnrichedLog |
net472 | 303μs | 640ns | 2.39μs | 0.456 | 0.152 | 0 | 4.33 KB |
| master | EnrichedLog |
netcoreapp3.1 | 247μs | 1.42μs | 10.6μs | 0 | 0 | 0 | 4.21 KB |
| #2655 | EnrichedLog |
net472 | 305μs | 1.19μs | 4.43μs | 0.453 | 0.151 | 0 | 4.33 KB |
| #2655 | EnrichedLog |
netcoreapp3.1 | 247μs | 1.21μs | 8.7μs | 0 | 0 | 0 | 4.21 KB |
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | EnrichedLog |
net472 | 8.46μs | 29.6ns | 111ns | 0.506 | 0 | 0 | 3.23 KB |
| master | EnrichedLog |
netcoreapp3.1 | 6.6μs | 32.1ns | 128ns | 0.0502 | 0 | 0 | 3.6 KB |
| #2655 | EnrichedLog |
net472 | 8.15μs | 23.9ns | 92.7ns | 0.503 | 0 | 0 | 3.23 KB |
| #2655 | EnrichedLog |
netcoreapp3.1 | 6.76μs | 31ns | 112ns | 0.0495 | 0 | 0 | 3.6 KB |
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | SendReceive |
net472 | 2.52μs | 12.6ns | 58ns | 0.161 | 0.00123 | 0 | 1.01 KB |
| master | SendReceive |
netcoreapp3.1 | 2.11μs | 8.37ns | 32.4ns | 0.0137 | 0 | 0 | 1.01 KB |
| #2655 | SendReceive |
net472 | 2.43μs | 11.4ns | 46.9ns | 0.16 | 0.00117 | 0 | 1.01 KB |
| #2655 | SendReceive |
netcoreapp3.1 | 2.24μs | 12.4ns | 79.5ns | 0.0136 | 0 | 0 | 1.01 KB |
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | EnrichedLog |
net472 | 6.28μs | 25.3ns | 98.2ns | 0.292 | 0 | 0 | 1.87 KB |
| master | EnrichedLog |
netcoreapp3.1 | 5.39μs | 17ns | 85ns | 0.0192 | 0 | 0 | 1.49 KB |
| #2655 | EnrichedLog |
net472 | 6.72μs | 43.3ns | 430ns | 0.29 | 0 | 0 | 1.87 KB |
| #2655 | EnrichedLog |
netcoreapp3.1 | 5.55μs | 27ns | 121ns | 0.0195 | 0 | 0 | 1.49 KB |
Benchmarks.Trace.SpanBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | StartFinishSpan |
net472 | 931ns | 2.92ns | 10.9ns | 0.0718 | 0 | 0 | 457 B |
| master | StartFinishSpan |
netcoreapp3.1 | 955ns | 5.53ns | 45.6ns | 0.00626 | 0 | 0 | 456 B |
| master | StartFinishScope |
net472 | 1.15μs | 5.06ns | 18.9ns | 0.0843 | 0 | 0 | 538 B |
| master | StartFinishScope |
netcoreapp3.1 | 1.11μs | 5.94ns | 43.2ns | 0.00802 | 0 | 0 | 576 B |
| #2655 | StartFinishSpan |
net472 | 940ns | 2.89ns | 11.2ns | 0.0719 | 0 | 0 | 457 B |
| #2655 | StartFinishSpan |
netcoreapp3.1 | 923ns | 3.74ns | 14.5ns | 0.00638 | 0 | 0 | 456 B |
| #2655 | StartFinishScope |
net472 | 1.17μs | 4.45ns | 17.2ns | 0.0842 | 0 | 0 | 538 B |
| #2655 | StartFinishScope |
netcoreapp3.1 | 1.13μs | 6.01ns | 43.3ns | 0.00778 | 0 | 0 | 576 B |
Benchmarks.Trace.TraceAnnotationsBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | RunOnMethodBegin |
net472 | 1.34μs | 6.1ns | 23.6ns | 0.084 | 0 | 0 | 538 B |
| master | RunOnMethodBegin |
netcoreapp3.1 | 1.24μs | 5.82ns | 22.5ns | 0.00747 | 0 | 0 | 576 B |
| #2655 | RunOnMethodBegin |
net472 | 1.37μs | 6.6ns | 27.2ns | 0.0839 | 0 | 0 | 538 B |
| #2655 | RunOnMethodBegin |
netcoreapp3.1 | 1.21μs | 5.3ns | 19.8ns | 0.00781 | 0 | 0 | 576 B |
pierotibou
approved these changes
Apr 11, 2022
zacharycmontoya
approved these changes
Apr 11, 2022
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary of changes
Reason for change
We occasionally see the GraphQL process fail to exit correctly. This causes flaky test behaviour, because in that case we often don't receive the telemetry. Taking a memory dump will help us to diagnose the problem.
Implementation details
Downloads procdump and runs against the process. Crude, but it works, assuming the process isn't just a bit slow in shutting down. Now we play the waiting game.
Test coverage
Did a test in which I remove the shutdown endpoint in graphql, so it never shuts down. This generates the memory dump as expected, and uploads it inside the
logsartifact for the job.