Avoid multiple configuration source enumeration#3178
Conversation
andrewlock
left a comment
There was a problem hiding this comment.
Looking good, just a couple of comments
- I would try to decouple the default config source from
GlobalSettings. It doesn't really belong there IMO - Some of
GlobalSettingsmay be obsolete, might be worth looking into
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
45afa07 to
1b12a26
Compare
This comment has been minimized.
This comment has been minimized.
3139862 to
1b12a26
Compare
This comment has been minimized.
This comment has been minimized.
1b12a26 to
2da49e3
Compare
Benchmarks Report 🐌Benchmarks for #3178 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 - Unknown 🤷 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 - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.ILoggerBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.Log4netBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.SpanBenchmark - Same speed ✔️ Same allocations ✔️Raw results
Benchmarks.Trace.TraceAnnotationsBenchmark - Same speed ✔️ Same allocations ✔️Raw results
|
Code Coverage Report 📊✔️ Merging #3178 into master will not change line coverage
View the full report for further details: Datadog.Trace Breakdown ✔️
The following classes have significant coverage changes.
The following classes were added in #3178:
View the full reports for further details: |
| exception = ex; | ||
|
|
||
| if (_globalSettings.DebugEnabled) | ||
| if (_isDebugEnabled) |
There was a problem hiding this comment.
Nit: Do we really need this field anymore? Can't we just do
| if (_isDebugEnabled) | |
| if (GlobalSettings.Instance.DebugEnabled) |
There was a problem hiding this comment.
Total nit though, take it or leave it :)
OmerRaviv
left a comment
There was a problem hiding this comment.
LGTM, sweet improvement. Thanks!
Summary of changes
Change
GlobalSettings:IConfigurationSource ConfigurationSourcestatic property, and initialize it withCreateDefaultConfigurationSourcemethod.CreateDefaultConfigurationSourceto avoid multiple enumeration of configuration sources, and useConfigurationSourceproperty instead.DebuggerSource SourcetoInstanceto match naming conventions of other single tones.Reason for change
Avoid multiple enumeration of configuration sources