-
Notifications
You must be signed in to change notification settings - Fork 793
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 some collection expressions #6106
base: main
Are you sure you want to change the base?
use some collection expressions #6106
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also think that collection expressions are more readable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -29,19 +29,19 @@ public static void Main() | |||
.AddView(instrumentName: "MyCounter", name: "MyCounterRenamed") | |||
|
|||
// Change Histogram boundaries using the Explicit Bucket Histogram aggregation. | |||
.AddView(instrumentName: "MyHistogram", new ExplicitBucketHistogramConfiguration() { Boundaries = new double[] { 10, 20 } }) | |||
.AddView(instrumentName: "MyHistogram", new ExplicitBucketHistogramConfiguration() { Boundaries = [10, 20] }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to highlight that we are creating double's array. It affects couple of other places.
.AddView(instrumentName: "MyHistogram", new ExplicitBucketHistogramConfiguration() { Boundaries = [10, 20] }) | |
.AddView(instrumentName: "MyHistogram", new ExplicitBucketHistogramConfiguration() { Boundaries = [10.0, 20.0] }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to fix other places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked this and Boundaries
is a double array so I think this is safe. The compiler will reject an int array.
opentelemetry-dotnet/src/OpenTelemetry/Metrics/View/ExplicitBucketHistogramConfiguration.cs
Line 26 in cccf1ec
public double[]? Boundaries |
However since this is a doc example, I'm good if we want to insist on specifying the types here.
Co-authored-by: Piotr Kiełkowicz <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All places using double should follow xy.0
notation
This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or pushing will instruct the bot to automatically remove the label. This bot runs once per day. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6106 +/- ##
==========================================
- Coverage 86.39% 86.37% -0.02%
==========================================
Files 257 257
Lines 11640 11625 -15
==========================================
- Hits 10056 10041 -15
Misses 1584 1584
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 minor changes related to int
vs long
.
Other parts LGTM
Co-authored-by: Piotr Kiełkowicz <[email protected]>
Co-authored-by: Piotr Kiełkowicz <[email protected]>
@SimonCropp, sorry, it needs to be |
Fixes #
Design discussion issue #
Changes
IMO they are more readable. and in many scenarios result in better perf
Merge requirement checklist
CHANGELOG.md
files updated for non-trivial changes