-
Notifications
You must be signed in to change notification settings - Fork 969
Expand file tree
/
Copy pathDoubleGauge.java
More file actions
61 lines (54 loc) · 1.54 KB
/
DoubleGauge.java
File metadata and controls
61 lines (54 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/
package io.opentelemetry.api.metrics;
import io.opentelemetry.api.common.Attributes;
import io.opentelemetry.context.Context;
import javax.annotation.concurrent.ThreadSafe;
/**
* A gauge instrument that synchronously records {@code double} values.
*
* @since 1.38.0
*/
@ThreadSafe
public interface DoubleGauge {
/**
* Set the gauge value.
*
* @param value The current gauge value.
*/
void set(double value);
/**
* Records a value with a set of attributes.
*
* @param value The current gauge value.
* @param attributes A set of attributes to associate with the value.
*/
void set(double value, Attributes attributes);
/**
* Records a value with a set of attributes.
*
* @param value The current gauge value.
* @param attributes A set of attributes to associate with the value.
* @param context The explicit context to associate with this measurement.
*/
void set(double value, Attributes attributes, Context context);
/**
* Remove the instrument.
*
* @param attributes A set of attributes to identify the instrument.
* @since 1.56.0
*/
default void remove(Attributes attributes) {
remove(attributes, Context.current());
}
/**
* Remove the instrument.
*
* @param attributes A set of attributes to identify the instrument.
* @param context The explicit context to associate with this measurement.
* @since 1.56.0
*/
default void remove(Attributes attributes, Context context) {}
}