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