Skip to content

Commit

Permalink
fixup!
Browse files Browse the repository at this point in the history
  • Loading branch information
legendecas committed Oct 8, 2023
1 parent 80eb992 commit f4d12de
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
7 changes: 6 additions & 1 deletion packages/sdk-metrics/src/InstrumentDescriptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@
* limitations under the License.
*/

import { MetricAdvice, MetricOptions, ValueType, diag } from '@opentelemetry/api';
import {
MetricAdvice,
MetricOptions,
ValueType,
diag,
} from '@opentelemetry/api';
import { View } from './view/View';
import { equalsCaseInsensitive } from './utils';

Expand Down
10 changes: 5 additions & 5 deletions packages/sdk-metrics/src/ObservableResult.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ export class ObservableResultImpl implements ObservableResult {
*/
_buffer = new AttributeHashMap<number>();

constructor(private _instrumentName: string, private _valueType: ValueType) {}
constructor(
private _instrumentName: string,
private _valueType: ValueType
) {}

/**
* Observe a measurement of the value associated with the given attributes.
Expand All @@ -46,10 +49,7 @@ export class ObservableResultImpl implements ObservableResult {
);
return;
}
if (
this._valueType === ValueType.INT &&
!Number.isInteger(value)
) {
if (this._valueType === ValueType.INT && !Number.isInteger(value)) {
diag.warn(
`INT value type cannot accept a floating-point value for ${this._instrumentName}, ignoring the fractional digits.`
);
Expand Down

0 comments on commit f4d12de

Please sign in to comment.