1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | import { LabelKey, LabelValue, Metric, MetricDescriptorType } from '../export/types';
|
17 | import * as types from '../types';
|
18 | import { AccessorInterface } from '../types';
|
19 |
|
20 |
|
21 |
|
22 | export declare class DerivedGauge implements types.Meter {
|
23 | readonly constantLabels: Map<LabelKey, LabelValue>;
|
24 | private metricDescriptor;
|
25 | private labelKeysLength;
|
26 | private registeredPoints;
|
27 | private extractor?;
|
28 | private readonly constantLabelValues;
|
29 | private static readonly LABEL_VALUE;
|
30 | private static readonly LABEL_VALUES;
|
31 | private static readonly OBJECT;
|
32 | private static readonly ERROR_MESSAGE_INVALID_SIZE;
|
33 | private static readonly ERROR_MESSAGE_DUPLICATE_TIME_SERIES;
|
34 | private static readonly ERROR_MESSAGE_UNKNOWN_INTERFACE;
|
35 | |
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 | constructor(name: string, description: string, unit: string, type: MetricDescriptorType, labelKeys: LabelKey[], constantLabels: Map<LabelKey, LabelValue>);
|
46 | /**
|
47 | * Creates a TimeSeries. The value of a single point in the TimeSeries is
|
48 | * observed from a obj or a function. The ValueExtractor is invoked whenever
|
49 | * metrics are collected, meaning the reported value is up-to-date.
|
50 | *
|
51 | * @param labelValues The list of the label values.
|
52 | * @param objOrFn obj The obj to get the size or length or value from. If
|
53 | * multiple options are available, the value (ToValueInterface) takes
|
54 | * precedence first, followed by length and size. e.g value -> length ->
|
55 | * size.
|
56 | * fn is the function that will be called to get the current value
|
57 | * of the gauge.
|
58 | */
|
59 | createTimeSeries(labelValues: LabelValue[], objOrFn: AccessorInterface): void;
|
60 | /**
|
61 | * Removes the TimeSeries from the gauge metric, if it is present. i.e.
|
62 | * references to previous Point objects are invalid (not part of the
|
63 | * metric).
|
64 | *
|
65 | * @param labelValues The list of label values.
|
66 | */
|
67 | removeTimeSeries(labelValues: LabelValue[]): void;
|
68 | /**
|
69 | * Removes all TimeSeries from the gauge metric. i.e. references to all
|
70 | * previous Point objects are invalid (not part of the metric).
|
71 | */
|
72 | clear(): void;
|
73 | /**
|
74 | * Provides a Metric with one or more TimeSeries.
|
75 | *
|
76 | * @returns The Metric, or null if TimeSeries is not present in Metric.
|
77 | */
|
78 | getMetric(): Metric | null;
|
79 | }
|