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

Measurement type conversion done at the MeterProvider. #2136

Merged
merged 2 commits into from
Jul 14, 2021

Conversation

cijothomas
Copy link
Member

Changes

Measurement type conversion done at the MeterProvider, as this is the earliest stage this can be done. The rest of the pipeline deals with just Long or Double. (We need more refactoring to see if we can use generic base classes, and concrete LongAggregator and DoubleAggregator , instead of Aggregator containing both long and double, and only one being used..)

Modify SumAggregator to be modified to be monotonic only, as the only instrument supported is Counter which is only for monotonic values.

Please provide a brief description of the changes here.

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Design discussion issue #
  • Changes in public API reviewed

@cijothomas cijothomas requested a review from a team July 14, 2021 19:38
}

return new DataValue(sum);
return new DataValue(this.sumLong);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the public IDataValue Sum is not thread-safe. We may avoid that issue if we refactor to avoid SumMetricAggregator implementing both ISumMetric and IAggregator intefaces. The latter represents the thing which does the aggregation, and former is the "aggregation output". Will tackle this in another PR.

@codecov
Copy link

codecov bot commented Jul 14, 2021

Codecov Report

Merging #2136 (0833ae7) into metrics (8f525df) will increase coverage by 0.14%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           metrics    #2136      +/-   ##
===========================================
+ Coverage    83.50%   83.64%   +0.14%     
===========================================
  Files          211      211              
  Lines         6692     6664      -28     
===========================================
- Hits          5588     5574      -14     
+ Misses        1104     1090      -14     
Impacted Files Coverage Δ
src/OpenTelemetry/Metrics/AggregatorStore.cs 88.40% <100.00%> (ø)
src/OpenTelemetry/Metrics/MeterProviderSdk.cs 97.59% <100.00%> (ø)
...y/Metrics/MetricAggregators/SumMetricAggregator.cs 95.91% <100.00%> (+15.39%) ⬆️
...emetry/Metrics/Processors/MetricConsoleExporter.cs 85.18% <0.00%> (+3.70%) ⬆️

@cijothomas cijothomas merged commit 4814924 into metrics Jul 14, 2021
@cijothomas cijothomas deleted the cijothomas/metric_typeconversion branch July 14, 2021 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants