UNPKG

1.52 kBTypeScriptView Raw
1import { MetricAttributes, Observable } from './Metric';
2/**
3 * Interface that is being used in callback function for Observable Metric.
4 */
5export interface ObservableResult<AttributesTypes extends MetricAttributes = MetricAttributes> {
6 /**
7 * Observe a measurement of the value associated with the given attributes.
8 *
9 * @param value The value to be observed.
10 * @param attributes The attributes associated with the value. If more than
11 * one values associated with the same attributes values, SDK may pick the
12 * last one or simply drop the entire observable result.
13 */
14 observe(this: ObservableResult<AttributesTypes>, value: number, attributes?: AttributesTypes): void;
15}
16/**
17 * Interface that is being used in batch observable callback function.
18 */
19export interface BatchObservableResult<AttributesTypes extends MetricAttributes = MetricAttributes> {
20 /**
21 * Observe a measurement of the value associated with the given attributes.
22 *
23 * @param metric The observable metric to be observed.
24 * @param value The value to be observed.
25 * @param attributes The attributes associated with the value. If more than
26 * one values associated with the same attributes values, SDK may pick the
27 * last one or simply drop the entire observable result.
28 */
29 observe(this: BatchObservableResult<AttributesTypes>, metric: Observable<AttributesTypes>, value: number, attributes?: AttributesTypes): void;
30}
31//# sourceMappingURL=ObservableResult.d.ts.map
\No newline at end of file