UNPKG

3.25 kBTypeScriptView Raw
1import { Meter } from './Meter';
2import { BatchObservableCallback, Counter, Histogram, MetricOptions, ObservableCallback, ObservableCounter, ObservableGauge, ObservableUpDownCounter, UpDownCounter, MetricAttributes, Observable } from './Metric';
3/**
4 * NoopMeter is a noop implementation of the {@link Meter} interface. It reuses
5 * constant NoopMetrics for all of its methods.
6 */
7export declare class NoopMeter implements Meter {
8 constructor();
9 /**
10 * @see {@link Meter.createHistogram}
11 */
12 createHistogram(_name: string, _options?: MetricOptions): Histogram;
13 /**
14 * @see {@link Meter.createCounter}
15 */
16 createCounter(_name: string, _options?: MetricOptions): Counter;
17 /**
18 * @see {@link Meter.createUpDownCounter}
19 */
20 createUpDownCounter(_name: string, _options?: MetricOptions): UpDownCounter;
21 /**
22 * @see {@link Meter.createObservableGauge}
23 */
24 createObservableGauge(_name: string, _options?: MetricOptions): ObservableGauge;
25 /**
26 * @see {@link Meter.createObservableCounter}
27 */
28 createObservableCounter(_name: string, _options?: MetricOptions): ObservableCounter;
29 /**
30 * @see {@link Meter.createObservableUpDownCounter}
31 */
32 createObservableUpDownCounter(_name: string, _options?: MetricOptions): ObservableUpDownCounter;
33 /**
34 * @see {@link Meter.addBatchObservableCallback}
35 */
36 addBatchObservableCallback(_callback: BatchObservableCallback, _observables: Observable[]): void;
37 /**
38 * @see {@link Meter.removeBatchObservableCallback}
39 */
40 removeBatchObservableCallback(_callback: BatchObservableCallback): void;
41}
42export declare class NoopMetric {
43}
44export declare class NoopCounterMetric extends NoopMetric implements Counter {
45 add(_value: number, _attributes: MetricAttributes): void;
46}
47export declare class NoopUpDownCounterMetric extends NoopMetric implements UpDownCounter {
48 add(_value: number, _attributes: MetricAttributes): void;
49}
50export declare class NoopHistogramMetric extends NoopMetric implements Histogram {
51 record(_value: number, _attributes: MetricAttributes): void;
52}
53export declare class NoopObservableMetric {
54 addCallback(_callback: ObservableCallback): void;
55 removeCallback(_callback: ObservableCallback): void;
56}
57export declare class NoopObservableCounterMetric extends NoopObservableMetric implements ObservableCounter {
58}
59export declare class NoopObservableGaugeMetric extends NoopObservableMetric implements ObservableGauge {
60}
61export declare class NoopObservableUpDownCounterMetric extends NoopObservableMetric implements ObservableUpDownCounter {
62}
63export declare const NOOP_METER: NoopMeter;
64export declare const NOOP_COUNTER_METRIC: NoopCounterMetric;
65export declare const NOOP_HISTOGRAM_METRIC: NoopHistogramMetric;
66export declare const NOOP_UP_DOWN_COUNTER_METRIC: NoopUpDownCounterMetric;
67export declare const NOOP_OBSERVABLE_COUNTER_METRIC: NoopObservableCounterMetric;
68export declare const NOOP_OBSERVABLE_GAUGE_METRIC: NoopObservableGaugeMetric;
69export declare const NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC: NoopObservableUpDownCounterMetric;
70/**
71 * Create a no-op Meter
72 */
73export declare function createNoopMeter(): Meter;
74//# sourceMappingURL=NoopMeter.d.ts.map
\No newline at end of file