Fix HotChocolate duck typing error#7930
Conversation
Snapshots difference summaryThe following differences have been observed in committed snapshots. It is meant to help the reviewer. 4 occurrences of : + {
+ TraceId: Id_12,
+ SpanId: Id_13,
+ Name: aspnet_core.request,
+ Resource: POST /graphql/{*slug},
+ Service: Samples.HotChocolate,
+ Type: web,
+ Tags: {
+ aspnet_core.endpoint: Hot Chocolate GraphQL Pipeline,
+ aspnet_core.route: /graphql/{**slug},
+ component: aspnet_core,
+ env: integration_tests,
+ http.method: POST,
+ http.request.headers.host: localhost:00000,
+ http.route: /graphql/{**slug},
+ http.status_code: 200,
+ http.url: http://localhost:00000/graphql,
+ http.useragent: testhelper,
+ language: dotnet,
+ runtime-id: Guid_1,
+ span.kind: server,
+ version: 1.0.0
+ },
+ Metrics: {
+ process_id: 0,
+ _dd.top_level: 1.0,
+ _dd.tracer_kr: 1.0,
+ _sampling_priority_v1: 1.0
+ }
+ },
[...]
- SpanId: Id_12,
+ SpanId: Id_14,
4 occurrences of : - SpanId: Id_13,
+ SpanId: Id_15,
4 occurrences of : - SpanId: Id_14,
+ SpanId: Id_16,
4 occurrences of : - SpanId: Id_15,
+ SpanId: Id_17,
2 occurrences of : + language: dotnet,
+ runtime-id: Guid_1,
+ span.kind: server,
+ _dd.base_service: Samples.HotChocolate
+ },
+ Metrics: {
+ _dd.top_level: 1.0
+ }
+ },
+ {
+ TraceId: Id_12,
+ SpanId: Id_18,
+ Name: graphql.execute,
+ Resource: Query ErrorQuery,
+ Service: Samples.HotChocolate-graphql,
+ Type: graphql,
+ ParentId: Id_13,
+ Error: 1,
+ Tags: {
+ component: HotChocolate,
+ env: integration_tests,
+ error.msg: 1 error(s),
+ error.stack:
[...]
+ error.type: HotChocolate.Error,
+ events: [{"name":"dd.graphql.query.error","time_unix_nano":<DateTimeOffset.Now>,"attributes":{"message":"Unexpected Execution Error","locations":["1:18"],"path":["throwExceptionIndex"],"stacktrace":" at Samples.HotChocolate.Query.ThrowExceptionIndex() in Query.cs:line 00","extensions.int":1,"extensions.float":1.1,"extensions.str":"1","extensions.bool":true,"extensions.other":"[1,foo]","extensions.sbyte":-42,"extensions.byte":42,"extensions.short":-1000,"extensions.ushort":1000,"extensions.uint":4294967295,"extensions.long":-9223372036854775808,"extensions.ulong":"18446744073709551615","extensions.decimal":"3.14159265358979","extensions.double":3.141592653589793,"extensions.char":"A"}}],
+ graphql.operation.name: ErrorQuery,
+ graphql.operation.type: Query,
+ graphql.source:
[...]
+ throwExceptionIndex
2 occurrences of : + language: dotnet,
+ span.kind: server,
+ version: 1.0.0
+ }
+ },
+ {
+ TraceId: Id_12,
+ SpanId: Id_18,
+ Name: graphql.execute,
+ Resource: Query ErrorQuery,
+ Service: Samples.HotChocolate,
+ Type: graphql,
+ ParentId: Id_13,
+ Error: 1,
+ Tags: {
+ component: HotChocolate,
+ env: integration_tests,
+ error.msg: 1 error(s),
+ error.stack:
[...]
+ error.type: HotChocolate.Error,
+ events: [{"name":"dd.graphql.query.error","time_unix_nano":<DateTimeOffset.Now>,"attributes":{"message":"Unexpected Execution Error","locations":["1:18"],"path":["throwExceptionIndex"],"stacktrace":" at Samples.HotChocolate.Query.ThrowExceptionIndex() in Query.cs:line 00","extensions.int":1,"extensions.float":1.1,"extensions.str":"1","extensions.bool":true,"extensions.other":"[1,foo]","extensions.sbyte":-42,"extensions.byte":42,"extensions.short":-1000,"extensions.ushort":1000,"extensions.uint":4294967295,"extensions.long":-9223372036854775808,"extensions.ulong":"18446744073709551615","extensions.decimal":"3.14159265358979","extensions.double":3.141592653589793,"extensions.char":"A"}}],
+ graphql.operation.name: ErrorQuery,
+ graphql.operation.type: Query,
+ graphql.source:
[...]
+ throwExceptionIndex
|
BenchmarksBenchmarks Report for benchmark platform 🐌Benchmarks for #7930 compared to master:
The following thresholds were used for comparing the benchmark speeds:
Allocation changes below 0.5% are ignored. Benchmark detailsBenchmarks.Trace.ActivityBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.Asm.AppSecBodyBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.Asm.AppSecEncoderBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.Asm.AppSecWafBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.AspNetCoreBenchmark - Unknown 🤷 More allocations
|
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.AspNetCoreBenchmark.SendRequest‑netcoreapp3.1 | 21.18 KB | 21.32 KB | 140 B | 0.66% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | SendRequest |
net6.0 | 83.6μs | 132ns | 476ns | 0 | 0 | 0 | 18.97 KB |
| master | SendRequest |
netcoreapp3.1 | 96.6μs | 416ns | 2.94μs | 0 | 0 | 0 | 21.18 KB |
| master | SendRequest |
net472 | 0ns | 0ns | 0ns | 0 | 0 | 0 | 0 b |
| #7930 | SendRequest |
net6.0 | 84.1μs | 156ns | 604ns | 0 | 0 | 0 | 18.98 KB |
| #7930 | SendRequest |
netcoreapp3.1 | 96.4μs | 65.1ns | 235ns | 0 | 0 | 0 | 21.32 KB |
| #7930 | SendRequest |
net472 | 0ns | 0ns | 0ns | 0 | 0 | 0 | 0 b |
Benchmarks.Trace.CharSliceBenchmark - Slower ⚠️ Same allocations ✔️
Slower ⚠️ in #7930
Benchmark
diff/base
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice‑netcoreapp3.1
1.397
2,794,500.00
3,904,750.00
Faster 🎉 in #7930
Benchmark
base/diff
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑netcoreapp3.1
2.319
1,890,300.00
815,000.00
| Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
|---|---|---|---|---|
| Benchmarks.Trace.CharSliceBenchmark.OriginalCharSlice‑netcoreapp3.1 | 1.397 | 2,794,500.00 | 3,904,750.00 |
| Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
|---|---|---|---|---|
| Benchmarks.Trace.CharSliceBenchmark.OptimizedCharSliceWithPool‑netcoreapp3.1 | 2.319 | 1,890,300.00 | 815,000.00 |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | OriginalCharSlice |
net6.0 | 2.02ms | 494ns | 1.85μs | 0 | 0 | 0 | 640 KB |
| master | OriginalCharSlice |
netcoreapp3.1 | 2.8ms | 4.24μs | 26.8μs | 0 | 0 | 0 | 640 KB |
| master | OriginalCharSlice |
net472 | 2.68ms | 727ns | 2.82μs | 0 | 0 | 0 | 638.98 KB |
| master | OptimizedCharSlice |
net6.0 | 1.42ms | 1.02μs | 3.82μs | 0 | 0 | 0 | 0 b |
| master | OptimizedCharSlice |
netcoreapp3.1 | 2.83ms | 557ns | 2.01μs | 0 | 0 | 0 | 0 b |
| master | OptimizedCharSlice |
net472 | 2.03ms | 779ns | 3.11μs | 0 | 0 | 0 | 0 b |
| master | OptimizedCharSliceWithPool |
net6.0 | 1.01ms | 378ns | 1.42μs | 0 | 0 | 0 | 0 b |
| master | OptimizedCharSliceWithPool |
netcoreapp3.1 | 1.89ms | 1.64μs | 6.35μs | 0 | 0 | 0 | 0 b |
| master | OptimizedCharSliceWithPool |
net472 | 1.13ms | 747ns | 2.89μs | 0 | 0 | 0 | 0 b |
| #7930 | OriginalCharSlice |
net6.0 | 1.96ms | 525ns | 1.96μs | 0 | 0 | 0 | 640 KB |
| #7930 | OriginalCharSlice |
netcoreapp3.1 | 3.91ms | 2.36μs | 8.83μs | 0 | 0 | 0 | 640.05 KB |
| #7930 | OriginalCharSlice |
net472 | 2.66ms | 479ns | 1.66μs | 0 | 0 | 0 | 638.98 KB |
| #7930 | OptimizedCharSlice |
net6.0 | 1.47ms | 2.77μs | 10.7μs | 0 | 0 | 0 | 0 b |
| #7930 | OptimizedCharSlice |
netcoreapp3.1 | 2.87ms | 545ns | 1.89μs | 0 | 0 | 0 | 0 b |
| #7930 | OptimizedCharSlice |
net472 | 1.92ms | 1.06μs | 3.96μs | 0 | 0 | 0 | 0 b |
| #7930 | OptimizedCharSliceWithPool |
net6.0 | 1.01ms | 269ns | 969ns | 0 | 0 | 0 | 0 b |
| #7930 | OptimizedCharSliceWithPool |
netcoreapp3.1 | 815μs | 423ns | 2.77μs | 0 | 0 | 0 | 0 b |
| #7930 | OptimizedCharSliceWithPool |
net472 | 1.13ms | 783ns | 3.03μs | 0 | 0 | 0 | 0 b |
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Slower ⚠️ More allocations ⚠️
Slower ⚠️ in #7930
Benchmark
diff/base
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1
1.118
652,173.03
729,324.48
Faster 🎉 in #7930
Benchmark
base/diff
Base Median (ns)
Diff Median (ns)
Modality
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net472
1.168
1,021,761.61
874,532.37
More allocations ⚠️ in #7930
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1
41.82 KB
42.4 KB
578 B
1.38%
| Benchmark | diff/base | Base Median (ns) | Diff Median (ns) | Modality |
|---|---|---|---|---|
| Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1 | 1.118 | 652,173.03 | 729,324.48 |
| Benchmark | base/diff | Base Median (ns) | Diff Median (ns) | Modality |
|---|---|---|---|---|
| Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑net472 | 1.168 | 1,021,761.61 | 874,532.37 |
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark.WriteAndFlushEnrichedTraces‑netcoreapp3.1 | 41.82 KB | 42.4 KB | 578 B | 1.38% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | WriteAndFlushEnrichedTraces |
net6.0 | 657μs | 2.7μs | 10.5μs | 0 | 0 | 0 | 41.67 KB |
| master | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 652μs | 802ns | 3μs | 0 | 0 | 0 | 41.82 KB |
| master | WriteAndFlushEnrichedTraces |
net472 | 1.02ms | 4.54μs | 17.6μs | 4.46 | 0 | 0 | 55.75 KB |
| #7930 | WriteAndFlushEnrichedTraces |
net6.0 | 729μs | 1.77μs | 6.87μs | 0 | 0 | 0 | 41.8 KB |
| #7930 | WriteAndFlushEnrichedTraces |
netcoreapp3.1 | 720μs | 4.03μs | 25.8μs | 0 | 0 | 0 | 42.4 KB |
| #7930 | WriteAndFlushEnrichedTraces |
net472 | 878μs | 3.99μs | 15.5μs | 4.46 | 0 | 0 | 55.63 KB |
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | ExecuteNonQuery |
net6.0 | 1.84μs | 8.91ns | 33.3ns | 0 | 0 | 0 | 968 B |
| master | ExecuteNonQuery |
netcoreapp3.1 | 2.61μs | 9.57ns | 37.1ns | 0 | 0 | 0 | 960 B |
| master | ExecuteNonQuery |
net472 | 2.62μs | 0.771ns | 2.89ns | 0.144 | 0 | 0 | 931 B |
| #7930 | ExecuteNonQuery |
net6.0 | 1.87μs | 2.14ns | 8ns | 0 | 0 | 0 | 968 B |
| #7930 | ExecuteNonQuery |
netcoreapp3.1 | 2.64μs | 10.4ns | 40.3ns | 0 | 0 | 0 | 960 B |
| #7930 | ExecuteNonQuery |
net472 | 2.78μs | 4.55ns | 17.6ns | 0.139 | 0 | 0 | 931 B |
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | CallElasticsearch |
net6.0 | 1.68μs | 6.54ns | 25.3ns | 0 | 0 | 0 | 952 B |
| master | CallElasticsearch |
netcoreapp3.1 | 2.16μs | 10.5ns | 41.9ns | 0 | 0 | 0 | 968 B |
| master | CallElasticsearch |
net472 | 3.52μs | 3.05ns | 11.8ns | 0.141 | 0 | 0 | 955 B |
| master | CallElasticsearchAsync |
net6.0 | 1.71μs | 2.6ns | 10.1ns | 0 | 0 | 0 | 928 B |
| master | CallElasticsearchAsync |
netcoreapp3.1 | 2.44μs | 8.62ns | 33.4ns | 0 | 0 | 0 | 1.02 KB |
| master | CallElasticsearchAsync |
net472 | 3.42μs | 2.46ns | 9.54ns | 0.156 | 0 | 0 | 1.01 KB |
| #7930 | CallElasticsearch |
net6.0 | 1.67μs | 1.22ns | 4.74ns | 0 | 0 | 0 | 952 B |
| #7930 | CallElasticsearch |
netcoreapp3.1 | 2.25μs | 9.29ns | 36ns | 0 | 0 | 0 | 968 B |
| #7930 | CallElasticsearch |
net472 | 3.53μs | 7.04ns | 27.3ns | 0.14 | 0 | 0 | 955 B |
| #7930 | CallElasticsearchAsync |
net6.0 | 1.71μs | 8.4ns | 34.6ns | 0 | 0 | 0 | 928 B |
| #7930 | CallElasticsearchAsync |
netcoreapp3.1 | 2.35μs | 10.1ns | 37.9ns | 0 | 0 | 0 | 1.02 KB |
| #7930 | CallElasticsearchAsync |
net472 | 3.41μs | 0.954ns | 3.69ns | 0.154 | 0 | 0 | 1.01 KB |
Benchmarks.Trace.GraphQLBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | ExecuteAsync |
net6.0 | 1.83μs | 5.91ns | 22.9ns | 0 | 0 | 0 | 896 B |
| master | ExecuteAsync |
netcoreapp3.1 | 2.3μs | 10.7ns | 42.7ns | 0 | 0 | 0 | 896 B |
| master | ExecuteAsync |
net472 | 2.6μs | 3.45ns | 13.4ns | 0.129 | 0 | 0 | 858 B |
| #7930 | ExecuteAsync |
net6.0 | 1.9μs | 7.13ns | 27.6ns | 0 | 0 | 0 | 896 B |
| #7930 | ExecuteAsync |
netcoreapp3.1 | 2.29μs | 10.6ns | 41ns | 0 | 0 | 0 | 896 B |
| #7930 | ExecuteAsync |
net472 | 2.59μs | 1.61ns | 5.8ns | 0.13 | 0 | 0 | 858 B |
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | SendAsync |
net6.0 | 6.63μs | 25.5ns | 95.3ns | 0 | 0 | 0 | 2.29 KB |
| master | SendAsync |
netcoreapp3.1 | 8.95μs | 23.2ns | 86.8ns | 0 | 0 | 0 | 2.83 KB |
| master | SendAsync |
net472 | 12.1μs | 8.78ns | 34ns | 0.485 | 0 | 0 | 3.08 KB |
| #7930 | SendAsync |
net6.0 | 6.78μs | 20.6ns | 77.1ns | 0 | 0 | 0 | 2.29 KB |
| #7930 | SendAsync |
netcoreapp3.1 | 8.47μs | 21.6ns | 83.5ns | 0 | 0 | 0 | 2.83 KB |
| #7930 | SendAsync |
net472 | 12μs | 8.77ns | 32.8ns | 0.479 | 0 | 0 | 3.08 KB |
Benchmarks.Trace.Iast.StringAspectsBenchmark - Same speed ✔️ More allocations ⚠️
More allocations ⚠️ in #7930
Benchmark
Base Allocated
Diff Allocated
Change
Change %
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0
254.94 KB
276.62 KB
21.68 KB
8.50%
Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1
256.3 KB
275.62 KB
19.32 KB
7.54%
| Benchmark | Base Allocated | Diff Allocated | Change | Change % |
|---|---|---|---|---|
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑net6.0 | 254.94 KB | 276.62 KB | 21.68 KB | 8.50% |
| Benchmarks.Trace.Iast.StringAspectsBenchmark.StringConcatAspectBenchmark‑netcoreapp3.1 | 256.3 KB | 275.62 KB | 19.32 KB | 7.54% |
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | StringConcatBenchmark |
net6.0 | 44μs | 242ns | 1.33μs | 0 | 0 | 0 | 42.51 KB |
| master | StringConcatBenchmark |
netcoreapp3.1 | 48.9μs | 265ns | 1.48μs | 0 | 0 | 0 | 42.54 KB |
| master | StringConcatBenchmark |
net472 | 56.4μs | 267ns | 1.19μs | 0 | 0 | 0 | 49.15 KB |
| master | StringConcatAspectBenchmark |
net6.0 | 504μs | 1.86μs | 9.87μs | 0 | 0 | 0 | 254.94 KB |
| master | StringConcatAspectBenchmark |
netcoreapp3.1 | 515μs | 2.52μs | 10.7μs | 0 | 0 | 0 | 256.3 KB |
| master | StringConcatAspectBenchmark |
net472 | 398μs | 1.81μs | 6.51μs | 0 | 0 | 0 | 270.34 KB |
| #7930 | StringConcatBenchmark |
net6.0 | 48μs | 234ns | 937ns | 0 | 0 | 0 | 42.51 KB |
| #7930 | StringConcatBenchmark |
netcoreapp3.1 | 54.7μs | 658ns | 6.48μs | 0 | 0 | 0 | 42.54 KB |
| #7930 | StringConcatBenchmark |
net472 | 56.9μs | 110ns | 380ns | 0 | 0 | 0 | 49.15 KB |
| #7930 | StringConcatAspectBenchmark |
net6.0 | 474μs | 1.85μs | 9.07μs | 0 | 0 | 0 | 276.62 KB |
| #7930 | StringConcatAspectBenchmark |
netcoreapp3.1 | 527μs | 2.59μs | 11μs | 0 | 0 | 0 | 275.62 KB |
| #7930 | StringConcatAspectBenchmark |
net472 | 398μs | 2.03μs | 9.94μs | 0 | 0 | 0 | 270.34 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 |
net6.0 | 2.67μs | 13.4ns | 61.2ns | 0 | 0 | 0 | 1.69 KB |
| master | EnrichedLog |
netcoreapp3.1 | 3.68μs | 4.93ns | 19.1ns | 0 | 0 | 0 | 1.7 KB |
| master | EnrichedLog |
net472 | 3.99μs | 4.91ns | 19ns | 0.238 | 0 | 0 | 1.6 KB |
| #7930 | EnrichedLog |
net6.0 | 2.68μs | 13.1ns | 55.6ns | 0 | 0 | 0 | 1.69 KB |
| #7930 | EnrichedLog |
netcoreapp3.1 | 3.47μs | 16.8ns | 67.3ns | 0 | 0 | 0 | 1.7 KB |
| #7930 | EnrichedLog |
net472 | 3.92μs | 3.04ns | 11.8ns | 0.235 | 0 | 0 | 1.6 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 |
net6.0 | 123μs | 133ns | 499ns | 0 | 0 | 0 | 4.31 KB |
| master | EnrichedLog |
netcoreapp3.1 | 126μs | 34.9ns | 130ns | 0 | 0 | 0 | 4.31 KB |
| master | EnrichedLog |
net472 | 165μs | 22.5ns | 81.1ns | 0 | 0 | 0 | 4.51 KB |
| #7930 | EnrichedLog |
net6.0 | 122μs | 120ns | 434ns | 0 | 0 | 0 | 4.31 KB |
| #7930 | EnrichedLog |
netcoreapp3.1 | 128μs | 172ns | 665ns | 0 | 0 | 0 | 4.31 KB |
| #7930 | EnrichedLog |
net472 | 166μs | 11.9ns | 45.9ns | 0 | 0 | 0 | 4.51 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 |
net6.0 | 5.03μs | 17.1ns | 66ns | 0 | 0 | 0 | 2.24 KB |
| master | EnrichedLog |
netcoreapp3.1 | 6.67μs | 24.6ns | 92.1ns | 0 | 0 | 0 | 2.26 KB |
| master | EnrichedLog |
net472 | 7.82μs | 9.07ns | 35.1ns | 0.311 | 0 | 0 | 2.05 KB |
| #7930 | EnrichedLog |
net6.0 | 5.12μs | 15.3ns | 59.1ns | 0 | 0 | 0 | 2.24 KB |
| #7930 | EnrichedLog |
netcoreapp3.1 | 6.83μs | 27.6ns | 107ns | 0 | 0 | 0 | 2.26 KB |
| #7930 | EnrichedLog |
net472 | 7.58μs | 5.01ns | 18.7ns | 0.304 | 0 | 0 | 2.05 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 |
net6.0 | 1.96μs | 9.68ns | 41.1ns | 0 | 0 | 0 | 1.12 KB |
| master | SendReceive |
netcoreapp3.1 | 2.48μs | 3.71ns | 14.4ns | 0 | 0 | 0 | 1.14 KB |
| master | SendReceive |
net472 | 2.98μs | 1.7ns | 6.57ns | 0.165 | 0 | 0 | 1.12 KB |
| #7930 | SendReceive |
net6.0 | 1.97μs | 4.86ns | 18.8ns | 0 | 0 | 0 | 1.12 KB |
| #7930 | SendReceive |
netcoreapp3.1 | 2.52μs | 12.6ns | 57.8ns | 0 | 0 | 0 | 1.14 KB |
| #7930 | SendReceive |
net472 | 3.01μs | 1.7ns | 6.14ns | 0.166 | 0 | 0 | 1.12 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 |
net6.0 | 4.3μs | 1.44ns | 5.59ns | 0 | 0 | 0 | 1.58 KB |
| master | EnrichedLog |
netcoreapp3.1 | 5.82μs | 16.8ns | 65.2ns | 0 | 0 | 0 | 1.63 KB |
| master | EnrichedLog |
net472 | 6.82μs | 9.25ns | 35.8ns | 0.306 | 0 | 0 | 2.03 KB |
| #7930 | EnrichedLog |
net6.0 | 4.34μs | 7.36ns | 25.5ns | 0 | 0 | 0 | 1.58 KB |
| #7930 | EnrichedLog |
netcoreapp3.1 | 5.74μs | 15.8ns | 61.3ns | 0 | 0 | 0 | 1.63 KB |
| #7930 | EnrichedLog |
net472 | 6.74μs | 5.76ns | 20.8ns | 0.303 | 0 | 0 | 2.03 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 |
net6.0 | 768ns | 0.336ns | 1.3ns | 0 | 0 | 0 | 520 B |
| master | StartFinishSpan |
netcoreapp3.1 | 956ns | 4.6ns | 19ns | 0 | 0 | 0 | 520 B |
| master | StartFinishSpan |
net472 | 907ns | 0.0351ns | 0.127ns | 0.0818 | 0 | 0 | 522 B |
| master | StartFinishScope |
net6.0 | 914ns | 4.52ns | 19.2ns | 0 | 0 | 0 | 640 B |
| master | StartFinishScope |
netcoreapp3.1 | 1.13μs | 5.07ns | 19.6ns | 0 | 0 | 0 | 640 B |
| master | StartFinishScope |
net472 | 1.1μs | 0.115ns | 0.415ns | 0.0935 | 0 | 0 | 602 B |
| master | StartFinishTwoScopes |
net6.0 | 1.77μs | 9.58ns | 54.2ns | 0 | 0 | 0 | 1.19 KB |
| master | StartFinishTwoScopes |
netcoreapp3.1 | 2.25μs | 10.4ns | 41.5ns | 0 | 0 | 0 | 1.19 KB |
| master | StartFinishTwoScopes |
net472 | 2.16μs | 1.62ns | 6.27ns | 0.162 | 0 | 0 | 1.08 KB |
| #7930 | StartFinishSpan |
net6.0 | 766ns | 1.11ns | 4.14ns | 0 | 0 | 0 | 520 B |
| #7930 | StartFinishSpan |
netcoreapp3.1 | 950ns | 4.94ns | 24.7ns | 0 | 0 | 0 | 520 B |
| #7930 | StartFinishSpan |
net472 | 887ns | 0.151ns | 0.583ns | 0.08 | 0 | 0 | 522 B |
| #7930 | StartFinishScope |
net6.0 | 900ns | 0.497ns | 1.79ns | 0 | 0 | 0 | 640 B |
| #7930 | StartFinishScope |
netcoreapp3.1 | 1.11μs | 5.65ns | 27.7ns | 0 | 0 | 0 | 640 B |
| #7930 | StartFinishScope |
net472 | 1.07μs | 0.0657ns | 0.255ns | 0.091 | 0 | 0 | 602 B |
| #7930 | StartFinishTwoScopes |
net6.0 | 1.78μs | 8.74ns | 36ns | 0 | 0 | 0 | 1.19 KB |
| #7930 | StartFinishTwoScopes |
netcoreapp3.1 | 2.25μs | 10.3ns | 41.2ns | 0 | 0 | 0 | 1.19 KB |
| #7930 | StartFinishTwoScopes |
net472 | 2.12μs | 2.14ns | 8.28ns | 0.17 | 0 | 0 | 1.08 KB |
Benchmarks.Trace.TraceAnnotationsBenchmark - Same speed ✔️ Same allocations ✔️
Raw results
| Branch | Method | Toolchain | Mean | StdError | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---|---|---|---|---|---|---|---|---|---|
| master | RunOnMethodBegin |
net6.0 | 1.04μs | 5.35ns | 25.7ns | 0 | 0 | 0 | 640 B |
| master | RunOnMethodBegin |
netcoreapp3.1 | 1.35μs | 5.29ns | 19.1ns | 0 | 0 | 0 | 640 B |
| master | RunOnMethodBegin |
net472 | 1.42μs | 0.992ns | 3.71ns | 0.0917 | 0 | 0 | 602 B |
| #7930 | RunOnMethodBegin |
net6.0 | 1.06μs | 1.04ns | 4.03ns | 0 | 0 | 0 | 640 B |
| #7930 | RunOnMethodBegin |
netcoreapp3.1 | 1.34μs | 3.12ns | 11.7ns | 0 | 0 | 0 | 640 B |
| #7930 | RunOnMethodBegin |
net472 | 1.43μs | 1.22ns | 4.71ns | 0.0926 | 0 | 0 | 602 B |
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (7930) and master. ✅ No regressions detected - check the details below Full Metrics ComparisonFakeDbCommand
HttpMessageHandler
Comparison explanationExecution-time benchmarks measure the whole time it takes to execute a program, and are intended to measure the one-off costs. Cases where the execution time results for the PR are worse than latest master results are highlighted in **red**. The following thresholds were used for comparing the execution times:
Note that these results are based on a single point-in-time result for each branch. For full results, see the dashboard. Graphs show the p99 interval based on the mean and StdDev of the test run, as well as the mean value of the run (shown as a diamond below the graph). Duration chartsFakeDbCommand (.NET Framework 4.8)gantt
title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7930) - mean (69ms) : 67, 70
master - mean (74ms) : 71, 76
section Bailout
This PR (7930) - mean (72ms) : 72, 73
master - mean (77ms) : 76, 79
section CallTarget+Inlining+NGEN
This PR (7930) - mean (1,015ms) : 944, 1085
master - mean (1,057ms) : 976, 1138
FakeDbCommand (.NET Core 3.1)gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7930) - mean (106ms) : 103, 109
master - mean (113ms) : 110, 116
section Bailout
This PR (7930) - mean (107ms) : 105, 108
master - mean (115ms) : 112, 118
section CallTarget+Inlining+NGEN
This PR (7930) - mean (707ms) : 678, 737
master - mean (745ms) : 710, 780
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7930) - mean (93ms) : 91, 96
master - mean (101ms) : 98, 104
section Bailout
This PR (7930) - mean (94ms) : 92, 95
master - mean (102ms) : 100, 104
section CallTarget+Inlining+NGEN
This PR (7930) - mean (667ms) : 644, 691
master - mean (691ms) : 667, 715
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7930) - mean (92ms) : 90, 95
master - mean (100ms) : 97, 103
section Bailout
This PR (7930) - mean (93ms) : 92, 94
master - mean (101ms) : 99, 103
section CallTarget+Inlining+NGEN
This PR (7930) - mean (631ms) : 617, 646
master - mean (660ms) : 636, 683
HttpMessageHandler (.NET Framework 4.8)gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7930) - mean (194ms) : 189, 198
master - mean (193ms) : 190, 197
section Bailout
This PR (7930) - mean (197ms) : 194, 200
master - mean (198ms) : 195, 200
section CallTarget+Inlining+NGEN
This PR (7930) - mean (1,120ms) : 1062, 1178
master - mean (1,116ms) : 1058, 1174
HttpMessageHandler (.NET Core 3.1)gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7930) - mean (277ms) : 273, 281
master - mean (277ms) : 272, 281
section Bailout
This PR (7930) - mean (277ms) : 273, 281
master - mean (277ms) : 273, 282
section CallTarget+Inlining+NGEN
This PR (7930) - mean (915ms) : 872, 958
master - mean (905ms) : 866, 945
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7930) - mean (270ms) : 266, 275
master - mean (271ms) : 265, 276
section Bailout
This PR (7930) - mean (270ms) : 266, 274
master - mean (270ms) : 265, 275
section CallTarget+Inlining+NGEN
This PR (7930) - mean (891ms) : 841, 940
master - mean (888ms) : 847, 928
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7930) - mean (269ms) : 265, 273
master - mean (270ms) : 260, 280
section Bailout
This PR (7930) - mean (269ms) : 266, 273
master - mean (268ms) : 264, 272
section CallTarget+Inlining+NGEN
This PR (7930) - mean (825ms) : 807, 843
master - mean (819ms) : 797, 842
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This comment has been minimized.
This comment has been minimized.
| graphql.source: | ||
| query ErrorQuery { | ||
| throwException | ||
| }, |
There was a problem hiding this comment.
This is the error thrown for indexes that previously would cause the exception.
|
Thanks for your reviews! |
Summary of changes
Fixes a
DuckTypePropertyOrFieldNotFoundExceptionthat occurs when HotChocolate GraphQL errors contain array index path segments instead of field name path segments.Reason for change
We have seen the following error:
This error was detected in customer installations.
Implementation details
Root cause: HotChocolate's
Pathclass is abstract with multiple implementations:NamePathSegment- for field names (has aNameproperty)IndexerPathSegment- for array indices (does NOT have aNameproperty)The previous implementation used duck typing with
PathStructthat expected aNameproperty, which failed when encounteringIndexerPathSegmentinstances.Solution:
PathStructduck type that assumed all path segments have aNamepropertyIPathinterface that duck types theToList()method available on the abstractPathclassIError.PathfromPathStructtoIPathHotChocolateCommon.ConstructErrorEvents()to:IPathToList()to get all path segments (works for bothNamePathSegmentandIndexerPathSegment)This approach is more robust as it relies on the public API (
ToList()) defined on the abstract class rather than assuming allimplementations share the same properties.
Test coverage
Added new test case
ThrowExceptionIndexto the existing HotChocolate integration tests:ErrorMiddlewaremodifies the error path to include["books", 1]to create anIndexerPathSegmentThe test ensures errors with
IndexerPathSegmentpaths are properly captured and serialized in span events without throwing duck typing exceptions.Other details