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

Use default Batch if no metrics are available to collect #2391

Merged
merged 1 commit into from
Sep 21, 2021

Conversation

cijothomas
Copy link
Member

@cijothomas cijothomas commented Sep 21, 2021

@cijothomas cijothomas requested a review from a team September 21, 2021 04:09
@codecov
Copy link

codecov bot commented Sep 21, 2021

Codecov Report

Merging #2391 (f3f3325) into main (47e1c5e) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2391   +/-   ##
=======================================
  Coverage   79.95%   79.96%           
=======================================
  Files         231      231           
  Lines        7440     7441    +1     
=======================================
+ Hits         5949     5950    +1     
  Misses       1491     1491           
Impacted Files Coverage Δ
src/OpenTelemetry/Metrics/MeterProviderSdk.cs 88.76% <100.00%> (+0.12%) ⬆️
...Telemetry/Internal/SelfDiagnosticsEventListener.cs 96.85% <0.00%> (-0.79%) ⬇️
...Zipkin/Implementation/ZipkinExporterEventSource.cs 72.72% <0.00%> (+9.09%) ⬆️

@cijothomas cijothomas merged commit 29110dc into open-telemetry:main Sep 21, 2021
{
this.metrics[i].SnapShot();
}

return new Batch<Metric>(this.metrics, indexSnapShot + 1);
return (target > 0) ? new Batch<Metric>(this.metrics, indexSnapShot + 1) : default;
Copy link
Member

Choose a reason for hiding this comment

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

nit: Looks like you could use target in here too (instead of indexSnapShot + 1): new Batch<Metric>(this.metrics, target)

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.

3 participants