-
Notifications
You must be signed in to change notification settings - Fork 821
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
feat(sdk-metrics-base): add ValueType support for sync instruments #2776
feat(sdk-metrics-base): add ValueType support for sync instruments #2776
Conversation
3530774
to
2e9dda7
Compare
Codecov Report
@@ Coverage Diff @@
## main #2776 +/- ##
=======================================
Coverage 93.42% 93.43%
=======================================
Files 159 159
Lines 5448 5452 +4
Branches 1144 1145 +1
=======================================
+ Hits 5090 5094 +4
Misses 358 358
|
2e9dda7
to
b4b2b0c
Compare
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 % nits
experimental/packages/opentelemetry-sdk-metrics-base/src/Instruments.ts
Outdated
Show resolved
Hide resolved
import { InstrumentDescriptor } from './InstrumentDescriptor'; | ||
import { WritableMetricStorage } from './state/WritableMetricStorage'; | ||
|
||
export class SyncInstrument { | ||
constructor(private _writableMetricStorage: WritableMetricStorage, private _descriptor: InstrumentDescriptor) { } | ||
private _valueType: ValueType; |
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.
Why have a separate private property when it can be accessed by the private descriptor already?
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 was thinking of reducing the property lookups in the path of counter.add
. It is probably trivial, never mind. Updated.
Which problem is this PR solving?
Trunc floating-point values if the ValueType is INT for synchronous instruments.
Type of change
How Has This Been Tested?
Checklist: