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

Memory mode: Adding support for synchronous instruments - Counter #6182

Conversation

asafm
Copy link
Contributor

@asafm asafm commented Jan 30, 2024

Epic

This is one of many PRs that implement #5105. See the complete plan here.
Specifically, this PR adds the implementation of MemoryMode for the synchronous instrument: counter.

What was done here?

This PR, relative to Exponential and Explicit Histogram PR, is rather trivial. It contains:

  • Using a reusable point for returning the result on doAggregateThenMaybeReset for both LongSumAggregator.Handle and DoubleSumAggregator.Handle.
  • Adding matching garbage collection benchmark tests
  • Adjusting and adding tests for LongSumAggregator and DoubleSumAggregator
  • Allowed to set the normalized allocate rate reduction percentage since, for both those aggregations, there was only a single allocation per Attributes, hence the reduction could not reach 99.8 as it did for the previous Exponential and Explicit Histogram aggregations.

Copy link

codecov bot commented Jan 30, 2024

Codecov Report

Attention: 27 lines in your changes are missing coverage. Please review.

Comparison is base (f123d78) 90.97% compared to head (e4b856b) 90.94%.

Files Patch % Lines
...nal/data/MutableExponentialHistogramPointData.java 12.50% 0 Missing and 14 partials ⚠️
.../metrics/internal/data/MutableDoublePointData.java 14.28% 0 Missing and 6 partials ⚠️
...dk/metrics/internal/data/MutableLongPointData.java 14.28% 0 Missing and 6 partials ⚠️
...ernal/data/MutableExponentialHistogramBuckets.java 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #6182      +/-   ##
============================================
- Coverage     90.97%   90.94%   -0.03%     
- Complexity     5670     5672       +2     
============================================
  Files           620      620              
  Lines         16535    16555      +20     
  Branches       1682     1695      +13     
============================================
+ Hits          15042    15056      +14     
+ Misses         1023     1009      -14     
- Partials        470      490      +20     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@jack-berg jack-berg left a comment

Choose a reason for hiding this comment

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

Couple minor comments, but looks good. Thanks!

@asafm
Copy link
Contributor Author

asafm commented Jan 31, 2024

@jack-berg pushed all fixes

@jack-berg jack-berg merged commit 0aa223d into open-telemetry:main Jan 31, 2024
17 of 18 checks passed
@asafm asafm deleted the memory-mode-sync-instruments-counter branch February 1, 2024 12:46
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