Skip to content
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

Store Metric Aggregation metadata into a field rather than properties dictionary to improve performance #930

Closed
cijothomas opened this issue Oct 2, 2018 · 0 comments · Fixed by #929
Assignees
Milestone

Comments

@cijothomas
Copy link
Contributor

AutoCollected MetricAggregator is configured as a TelemetryProcessor to be run before Sampling processors, and every item processed by it is tagged with a custom property indicating the version of the Aggregator. Accessing the Properties collection is expensive as its implemented as a ConcurrentDictionary.
https://github.com/Microsoft/ApplicationInsights-dotnet/blob/develop/src/Microsoft.ApplicationInsights/Metrics/Extensibility/AutocollectedMetricsExtraction/AutocollectedMetricsExtractor.cs#L216

Proposal here is to create a non-public field for DependencyTelemetry and RequestTelemetry to store this meta data. So MetricAggregator will use this field, avoiding expensive Dictionary access. To avoid change in behaviour, Getter for Properties will copy the value from the internal field to the Properties Dictionary. (during serialization properties are accessed and the field is copied over to the Dictionary, but this is happens only for those items which are sampled in)

Version Info

SDK Version :
.NET Version :
How Application was onboarded with SDK(VisualStudio/StatusMonitor/Azure Extension) :
OS :
Hosting Info (IIS/Azure WebApps/ etc) :

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant