Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
vmarchaud committed Sep 19, 2020
1 parent 2b1f3bd commit 1431e14
Show file tree
Hide file tree
Showing 15 changed files with 26 additions and 44 deletions.
12 changes: 4 additions & 8 deletions packages/opentelemetry-api/src/metrics/NoopMeter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,24 +131,21 @@ export class NoopMetric<T> implements UnboundMetric<T> {
}
}

export class NoopCounterMetric
extends NoopMetric<BoundCounter>
export class NoopCounterMetric extends NoopMetric<BoundCounter>
implements Counter {
add(value: number, labels: Labels) {
this.bind(labels).add(value);
}
}

export class NoopValueRecorderMetric
extends NoopMetric<BoundValueRecorder>
export class NoopValueRecorderMetric extends NoopMetric<BoundValueRecorder>
implements ValueRecorder {
record(value: number, labels: Labels) {
this.bind(labels).record(value);
}
}

export class NoopBaseObserverMetric
extends NoopMetric<BoundBaseObserver>
export class NoopBaseObserverMetric extends NoopMetric<BoundBaseObserver>
implements BaseObserver {
observation() {
return {
Expand All @@ -158,8 +155,7 @@ export class NoopBaseObserverMetric
}
}

export class NoopBatchObserverMetric
extends NoopMetric<void>
export class NoopBatchObserverMetric extends NoopMetric<void>
implements BatchObserver {}

export class NoopBoundCounter implements BoundCounter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ import {
import { BaseAbstractPlugin } from '../BaseAbstractPlugin';

/** This class represent the base to patch plugin. */
export abstract class BasePlugin<T>
extends BaseAbstractPlugin<T>
export abstract class BasePlugin<T> extends BaseAbstractPlugin<T>
implements Plugin<T> {
enable(
moduleExports: T,
Expand Down
3 changes: 1 addition & 2 deletions packages/opentelemetry-core/src/platform/node/BasePlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ import * as path from 'path';
import { BaseAbstractPlugin } from '../BaseAbstractPlugin';

/** This class represent the base to patch plugin. */
export abstract class BasePlugin<T>
extends BaseAbstractPlugin<T>
export abstract class BasePlugin<T> extends BaseAbstractPlugin<T>
implements Plugin<T> {
enable(
moduleExports: T,
Expand Down
3 changes: 1 addition & 2 deletions packages/opentelemetry-metrics/src/BaseObserverMetric.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ const NOOP_CALLBACK = () => {};
* This is a SDK implementation of Base Observer Metric.
* All observers should extend this class
*/
export abstract class BaseObserverMetric
extends Metric<BoundObserver>
export abstract class BaseObserverMetric extends Metric<BoundObserver>
implements api.BaseObserver {
protected _callback: (observerResult: api.ObserverResult) => unknown;

Expand Down
3 changes: 1 addition & 2 deletions packages/opentelemetry-metrics/src/BatchObserverMetric.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ const NOOP_CALLBACK = () => {};
const MAX_TIMEOUT_UPDATE_MS = 500;

/** This is a SDK implementation of Batch Observer Metric. */
export class BatchObserverMetric
extends Metric<BoundObserver>
export class BatchObserverMetric extends Metric<BoundObserver>
implements api.BatchObserver {
private _callback: (observerResult: api.BatchObserverResult) => void;
private _maxTimeoutUpdateMS: number;
Expand Down
12 changes: 4 additions & 8 deletions packages/opentelemetry-metrics/src/BoundInstrument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ export class BaseBoundInstrument {
* BoundCounter allows the SDK to observe/record a single metric event. The
* value of single instrument in the `Counter` associated with specified Labels.
*/
export class BoundCounter
extends BaseBoundInstrument
export class BoundCounter extends BaseBoundInstrument
implements api.BoundCounter {
constructor(
labels: api.Labels,
Expand Down Expand Up @@ -102,8 +101,7 @@ export class BoundCounter
* The value of single instrument in the `UpDownCounter` associated with
* specified Labels.
*/
export class BoundUpDownCounter
extends BaseBoundInstrument
export class BoundUpDownCounter extends BaseBoundInstrument
implements api.BoundCounter {
constructor(
labels: api.Labels,
Expand All @@ -123,8 +121,7 @@ export class BoundUpDownCounter
/**
* BoundMeasure is an implementation of the {@link BoundMeasure} interface.
*/
export class BoundValueRecorder
extends BaseBoundInstrument
export class BoundValueRecorder extends BaseBoundInstrument
implements api.BoundValueRecorder {
constructor(
labels: api.Labels,
Expand All @@ -144,8 +141,7 @@ export class BoundValueRecorder
/**
* BoundObserver is an implementation of the {@link BoundObserver} interface.
*/
export class BoundObserver
extends BaseBoundInstrument
export class BoundObserver extends BaseBoundInstrument
implements api.BoundBaseObserver {
constructor(
labels: api.Labels,
Expand Down
3 changes: 1 addition & 2 deletions packages/opentelemetry-metrics/src/SumObserverMetric.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ import { Batcher } from './export/Batcher';
import { MetricKind } from './export/types';

/** This is a SDK implementation of SumObserver Metric. */
export class SumObserverMetric
extends BaseObserverMetric
export class SumObserverMetric extends BaseObserverMetric
implements api.SumObserver {
constructor(
name: string,
Expand Down
3 changes: 1 addition & 2 deletions packages/opentelemetry-metrics/src/UpDownCounterMetric.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ import { Batcher } from './export/Batcher';
import { Metric } from './Metric';

/** This is a SDK implementation of UpDownCounter Metric. */
export class UpDownCounterMetric
extends Metric<BoundUpDownCounter>
export class UpDownCounterMetric extends Metric<BoundUpDownCounter>
implements api.UpDownCounter {
constructor(
name: string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ import { Batcher } from './export/Batcher';
import { MetricKind } from './export/types';

/** This is a SDK implementation of UpDownSumObserver Metric. */
export class UpDownSumObserverMetric
extends BaseObserverMetric
export class UpDownSumObserverMetric extends BaseObserverMetric
implements api.UpDownSumObserver {
constructor(
name: string,
Expand Down
3 changes: 1 addition & 2 deletions packages/opentelemetry-metrics/src/ValueObserverMetric.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ import { Batcher } from './export/Batcher';
import { MetricKind } from './export/types';

/** This is a SDK implementation of Value Observer Metric. */
export class ValueObserverMetric
extends BaseObserverMetric
export class ValueObserverMetric extends BaseObserverMetric
implements api.ValueObserver {
constructor(
name: string,
Expand Down
3 changes: 1 addition & 2 deletions packages/opentelemetry-metrics/src/ValueRecorderMetric.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ import { MetricKind } from './export/types';
import { Metric } from './Metric';

/** This is a SDK implementation of Value Recorder Metric. */
export class ValueRecorderMetric
extends Metric<BoundValueRecorder>
export class ValueRecorderMetric extends Metric<BoundValueRecorder>
implements api.ValueRecorder {
constructor(
name: string,
Expand Down
5 changes: 1 addition & 4 deletions packages/opentelemetry-plugin-http/src/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ import {
TraceFlags,
getExtractedSpanContext,
} from '@opentelemetry/api';
import {
BasePlugin,
NoRecordingSpan,
} from '@opentelemetry/core';
import { BasePlugin, NoRecordingSpan } from '@opentelemetry/core';
import {
ClientRequest,
IncomingMessage,
Expand Down
5 changes: 4 additions & 1 deletion packages/opentelemetry-shim-opentracing/src/shim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,10 @@ export class TracerShim extends opentracing.Tracer {
carrier,
api.defaultSetter,
setCorrelationContext(
api.setExtractedSpanContext(api.Context.ROOT_CONTEXT, oTelSpanContext),
api.setExtractedSpanContext(
api.Context.ROOT_CONTEXT,
oTelSpanContext
),
oTelSpanCorrelationContext
)
);
Expand Down
4 changes: 3 additions & 1 deletion packages/opentelemetry-tracing/src/Tracer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@ export class Tracer implements api.Tracer {
bind<T>(target: T, span?: api.Span): T {
return api.context.bind(
target,
span ? api.setActiveSpan(api.context.active(), span) : api.context.active()
span
? api.setActiveSpan(api.context.active(), span)
: api.context.active()
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@
*/

import { context, suppressInstrumentation } from '@opentelemetry/api';
import {
ExportResult,
unrefTimer,
} from '@opentelemetry/core';
import { ExportResult, unrefTimer } from '@opentelemetry/core';
import { SpanProcessor } from '../SpanProcessor';
import { BufferConfig } from '../types';
import { ReadableSpan } from './ReadableSpan';
Expand Down

0 comments on commit 1431e14

Please sign in to comment.