Skip to content

Commit

Permalink
chore: resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
mayurkale22 committed Jun 12, 2020
1 parent 555d168 commit 8f73840
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 15 deletions.
6 changes: 1 addition & 5 deletions packages/opentelemetry-api/src/metrics/Metric.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,18 +120,14 @@ export interface Counter extends UnboundMetric<BoundCounter> {
add(value: number, labels?: Labels): void;
}

<<<<<<< HEAD
export interface ValueRecorder extends UnboundMetric<BoundValueRecorder> {
=======
export interface UpDownCounter extends UnboundMetric<BoundCounter> {
/**
* Adds the given value to the current value. Values can be negative.
*/
add(value: number, labels?: Labels): void;
}

export interface Measure extends UnboundMetric<BoundMeasure> {
>>>>>>> a7dbd0b... feat: add the UpDownCounter instrument
export interface ValueRecorder extends UnboundMetric<BoundValueRecorder> {
/**
* Records the given value to this value recorder.
*/
Expand Down
9 changes: 7 additions & 2 deletions packages/opentelemetry-metrics/src/Meter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ import { ConsoleLogger } from '@opentelemetry/core';
import { Resource } from '@opentelemetry/resources';
import { BaseBoundInstrument } from './BoundInstrument';
import { UpDownCounterMetric } from './UpDownCounterMetric';
import { Metric, CounterMetric, ValueRecorderMetric, ObserverMetric } from './Metric';
import {
Metric,
CounterMetric,
ValueRecorderMetric,
ObserverMetric,
} from './Metric';
import {
MetricOptions,
DEFAULT_METRIC_OPTIONS,
Expand Down Expand Up @@ -68,9 +73,9 @@ export class Meter implements api.Meter {
return api.NOOP_VALUE_RECORDER_METRIC;
}
const opt: MetricOptions = {
absolute: true, // value recorders are defined as absolute by default
logger: this._logger,
...DEFAULT_METRIC_OPTIONS,
absolute: true, // value recorders are defined as absolute by default
...options,
};

Expand Down
5 changes: 3 additions & 2 deletions packages/opentelemetry-metrics/src/Metric.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export abstract class Metric<T extends BaseBoundInstrument>
description: this._options.description,
unit: this._options.unit,
metricKind: this._kind,
valueType: this._valueType
valueType: this._valueType,
};
}

Expand Down Expand Up @@ -134,7 +134,8 @@ export class CounterMetric extends Metric<BoundCounter> implements api.Counter {
}
}

export class MeasureMetric extends Metric<BoundMeasure> implements api.Measure {
export class ValueRecorderMetric extends Metric<BoundValueRecorder>
implements api.ValueRecorder {
protected readonly _absolute: boolean;

constructor(
Expand Down
5 changes: 0 additions & 5 deletions packages/opentelemetry-metrics/src/export/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,6 @@ export interface MetricDescriptor {
readonly unit: string;
readonly metricKind: MetricKind;
readonly valueType: ValueType;
<<<<<<< HEAD
readonly monotonic: boolean;
=======
readonly labelKeys: string[];
>>>>>>> a7dbd0b... feat: add the UpDownCounter instrument
}

/**
Expand Down
1 change: 0 additions & 1 deletion packages/opentelemetry-metrics/test/Meter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,6 @@ describe('Meter', () => {
assert.strictEqual(record.length, 1);
assert.deepStrictEqual(record[0].descriptor, {
description: '',
labelKeys: [],
metricKind: MetricKind.COUNTER,
name: 'name1',
unit: '1',
Expand Down

0 comments on commit 8f73840

Please sign in to comment.