@@ -21,18 +21,19 @@ import {
21
21
UnboundMetric ,
22
22
Labels ,
23
23
Counter ,
24
- ValueRecorder ,
25
- ValueObserver ,
24
+ Histogram ,
25
+ ObservableGauge ,
26
26
UpDownCounter ,
27
- BaseObserver ,
28
- UpDownSumObserver ,
27
+ ObservableBase ,
28
+ ObservableCounter ,
29
+ ObservableUpDownCounter ,
29
30
} from './types/Metric' ;
30
31
import {
31
- BoundValueRecorder ,
32
+ BoundHistogram ,
32
33
BoundCounter ,
33
- BoundBaseObserver ,
34
+ BoundObservableBase ,
34
35
} from './types/BoundInstrument' ;
35
- import { ObserverResult } from './types/ObserverResult ' ;
36
+ import { ObservableResult } from './types/ObservableResult ' ;
36
37
import { Observation } from './types/Observation' ;
37
38
38
39
/**
@@ -43,12 +44,12 @@ export class NoopMeter implements Meter {
43
44
constructor ( ) { }
44
45
45
46
/**
46
- * Returns constant noop value recorder .
47
+ * Returns a constant noop histogram .
47
48
* @param name the name of the metric.
48
49
* @param [options] the metric options.
49
50
*/
50
- createValueRecorder ( _name : string , _options ?: MetricOptions ) : ValueRecorder {
51
- return NOOP_VALUE_RECORDER_METRIC ;
51
+ createHistogram ( _name : string , _options ?: MetricOptions ) : Histogram {
52
+ return NOOP_HISTOGRAM_METRIC ;
52
53
}
53
54
54
55
/**
@@ -70,45 +71,45 @@ export class NoopMeter implements Meter {
70
71
}
71
72
72
73
/**
73
- * Returns constant noop value observer .
74
+ * Returns a constant noop observable gauge .
74
75
* @param name the name of the metric.
75
76
* @param [options] the metric options.
76
- * @param [callback] the value observer callback
77
+ * @param [callback] the observable gauge callback
77
78
*/
78
- createValueObserver (
79
+ createObservableGauge (
79
80
_name : string ,
80
81
_options ?: MetricOptions ,
81
- _callback ?: ( observerResult : ObserverResult ) => void
82
- ) : ValueObserver {
83
- return NOOP_VALUE_OBSERVER_METRIC ;
82
+ _callback ?: ( observableResult : ObservableResult ) => void
83
+ ) : ObservableGauge {
84
+ return NOOP_OBSERVABLE_GAUGE_METRIC ;
84
85
}
85
86
86
87
/**
87
- * Returns constant noop sum observer .
88
+ * Returns a constant noop observable counter .
88
89
* @param name the name of the metric.
89
90
* @param [options] the metric options.
90
- * @param [callback] the sum observer callback
91
+ * @param [callback] the observable counter callback
91
92
*/
92
- createSumObserver (
93
+ createObservableCounter (
93
94
_name : string ,
94
95
_options ?: MetricOptions ,
95
- _callback ?: ( observerResult : ObserverResult ) => void
96
- ) : ValueObserver {
97
- return NOOP_SUM_OBSERVER_METRIC ;
96
+ _callback ?: ( observableResult : ObservableResult ) => void
97
+ ) : ObservableCounter {
98
+ return NOOP_OBSERVABLE_COUNTER_METRIC ;
98
99
}
99
100
100
101
/**
101
- * Returns constant noop up down sum observer .
102
+ * Returns a constant noop up down observable counter .
102
103
* @param name the name of the metric.
103
104
* @param [options] the metric options.
104
- * @param [callback] the up down sum observer callback
105
+ * @param [callback] the up down observable counter callback
105
106
*/
106
- createUpDownSumObserver (
107
+ createObservableUpDownCounter (
107
108
_name : string ,
108
109
_options ?: MetricOptions ,
109
- _callback ?: ( observerResult : ObserverResult ) => void
110
- ) : UpDownSumObserver {
111
- return NOOP_UP_DOWN_SUM_OBSERVER_METRIC ;
110
+ _callback ?: ( observableResult : ObservableResult ) => void
111
+ ) : ObservableUpDownCounter {
112
+ return NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC ;
112
113
}
113
114
114
115
/**
@@ -165,20 +166,20 @@ export class NoopCounterMetric
165
166
}
166
167
}
167
168
168
- export class NoopValueRecorderMetric
169
- extends NoopMetric < BoundValueRecorder >
170
- implements ValueRecorder {
169
+ export class NoopHistogramMetric
170
+ extends NoopMetric < BoundHistogram >
171
+ implements Histogram {
171
172
record ( value : number , labels : Labels ) : void {
172
173
this . bind ( labels ) . record ( value ) ;
173
174
}
174
175
}
175
176
176
- export class NoopBaseObserverMetric
177
- extends NoopMetric < BoundBaseObserver >
178
- implements BaseObserver {
177
+ export class NoopObservableBaseMetric
178
+ extends NoopMetric < BoundObservableBase >
179
+ implements ObservableBase {
179
180
observation ( ) : Observation {
180
181
return {
181
- observer : this as BaseObserver ,
182
+ observable : this as ObservableBase ,
182
183
value : 0 ,
183
184
} ;
184
185
}
@@ -192,36 +193,36 @@ export class NoopBoundCounter implements BoundCounter {
192
193
}
193
194
}
194
195
195
- export class NoopBoundValueRecorder implements BoundValueRecorder {
196
+ export class NoopBoundHistogram implements BoundHistogram {
196
197
record ( _value : number , _baggage ?: unknown , _spanContext ?: unknown ) : void {
197
198
return ;
198
199
}
199
200
}
200
201
201
- export class NoopBoundBaseObserver implements BoundBaseObserver {
202
+ export class NoopBoundObservableBase implements BoundObservableBase {
202
203
update ( _value : number ) : void { }
203
204
}
204
205
205
206
export const NOOP_METER = new NoopMeter ( ) ;
206
207
export const NOOP_BOUND_COUNTER = new NoopBoundCounter ( ) ;
207
208
export const NOOP_COUNTER_METRIC = new NoopCounterMetric ( NOOP_BOUND_COUNTER ) ;
208
209
209
- export const NOOP_BOUND_VALUE_RECORDER = new NoopBoundValueRecorder ( ) ;
210
- export const NOOP_VALUE_RECORDER_METRIC = new NoopValueRecorderMetric (
211
- NOOP_BOUND_VALUE_RECORDER
210
+ export const NOOP_BOUND_HISTOGRAM = new NoopBoundHistogram ( ) ;
211
+ export const NOOP_HISTOGRAM_METRIC = new NoopHistogramMetric (
212
+ NOOP_BOUND_HISTOGRAM
212
213
) ;
213
214
214
- export const NOOP_BOUND_BASE_OBSERVER = new NoopBoundBaseObserver ( ) ;
215
- export const NOOP_VALUE_OBSERVER_METRIC = new NoopBaseObserverMetric (
216
- NOOP_BOUND_BASE_OBSERVER
215
+ export const NOOP_BOUND_OBSERVABLE_BASE = new NoopBoundObservableBase ( ) ;
216
+ export const NOOP_OBSERVABLE_GAUGE_METRIC = new NoopObservableBaseMetric (
217
+ NOOP_BOUND_OBSERVABLE_BASE
217
218
) ;
218
219
219
- export const NOOP_UP_DOWN_SUM_OBSERVER_METRIC = new NoopBaseObserverMetric (
220
- NOOP_BOUND_BASE_OBSERVER
220
+ export const NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC = new NoopObservableBaseMetric (
221
+ NOOP_BOUND_OBSERVABLE_BASE
221
222
) ;
222
223
223
- export const NOOP_SUM_OBSERVER_METRIC = new NoopBaseObserverMetric (
224
- NOOP_BOUND_BASE_OBSERVER
224
+ export const NOOP_OBSERVABLE_COUNTER_METRIC = new NoopObservableBaseMetric (
225
+ NOOP_BOUND_OBSERVABLE_BASE
225
226
) ;
226
227
227
228
export const NOOP_BATCH_OBSERVER = new NoopBatchObserver ( ) ;
0 commit comments