-
Notifications
You must be signed in to change notification settings - Fork 961
Expand file tree
/
Copy pathDoubleHistogram.java
More file actions
68 lines (60 loc) · 1.87 KB
/
DoubleHistogram.java
File metadata and controls
68 lines (60 loc) · 1.87 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
62
63
64
65
66
67
68
/*
* 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 Histogram instrument that records {@code double} values.
*
* @since 1.10.0
*/
@ThreadSafe
public interface DoubleHistogram {
/**
* Records a value.
*
* <p>Note: This may use {@code Context.current()} to pull the context associated with this
* measurement.
*
* @param value The amount of the measurement. MUST be non-negative.
*/
void record(double value);
/**
* Records a value with a set of attributes.
*
* <p>Note: This may use {@code Context.current()} to pull the context associated with this
* measurement.
*
* @param value The amount of the measurement. MUST be non-negative.
* @param attributes A set of attributes to associate with the value.
*/
void record(double value, Attributes attributes);
/**
* Records a value with a set of attributes.
*
* @param value The amount of the measurement. MUST be non-negative.
* @param attributes A set of attributes to associate with the value.
* @param context The explicit context to associate with this measurement.
*/
void record(double value, Attributes attributes, Context context);
/**
* Finish the instrument record.
*
* @param attributes A set of attributes to identify the instrument.
* @since 1.56.0
*/
default void finish(Attributes attributes) {
finish(attributes, Context.current());
}
/**
* Finish the instrument record.
*
* @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 finish(Attributes attributes, Context context) {}
}