File tree 6 files changed +14
-17
lines changed
examples/self-diagnostics
opentelemetry-sdk/src/metrics/internal
6 files changed +14
-17
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,9 @@ receivers:
8
8
otlp :
9
9
protocols :
10
10
grpc :
11
+ endpoint : 0.0.0.0:4317
11
12
http :
13
+ endpoint : 0.0.0.0:4318
12
14
13
15
exporters :
14
16
debug :
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ struct HistogramTracker<T> {
14
14
buckets : Mutex < Buckets < T > > ,
15
15
}
16
16
17
- impl < T > Aggregator < T > for HistogramTracker < T >
17
+ impl < T > Aggregator for HistogramTracker < T >
18
18
where
19
19
T : Number ,
20
20
{
@@ -88,7 +88,7 @@ impl<T: Number> Buckets<T> {
88
88
/// Summarizes a set of measurements as a histogram with explicitly defined
89
89
/// buckets.
90
90
pub ( crate ) struct Histogram < T : Number > {
91
- value_map : ValueMap < T , HistogramTracker < T > > ,
91
+ value_map : ValueMap < HistogramTracker < T > > ,
92
92
bounds : Vec < f64 > ,
93
93
record_min_max : bool ,
94
94
record_sum : bool ,
Original file line number Diff line number Diff line change 17
17
pub ( crate ) value : T :: AtomicTracker ,
18
18
}
19
19
20
- impl < T > Aggregator < T > for Assign < T >
20
+ impl < T > Aggregator for Assign < T >
21
21
where
22
22
T : Number ,
23
23
{
37
37
38
38
/// Summarizes a set of measurements as the last one made.
39
39
pub ( crate ) struct LastValue < T : Number > {
40
- value_map : ValueMap < T , Assign < T > > ,
40
+ value_map : ValueMap < Assign < T > > ,
41
41
start : Mutex < SystemTime > ,
42
42
}
43
43
Original file line number Diff line number Diff line change @@ -22,10 +22,7 @@ use crate::metrics::AttributeSet;
22
22
pub ( crate ) static STREAM_OVERFLOW_ATTRIBUTES : Lazy < Vec < KeyValue > > =
23
23
Lazy :: new ( || vec ! [ KeyValue :: new( "otel.metric.overflow" , "true" ) ] ) ;
24
24
25
- pub ( crate ) trait Aggregator < T >
26
- where
27
- T : Number ,
28
- {
25
+ pub ( crate ) trait Aggregator {
29
26
/// A static configuration that is needed in order to initialize aggregator.
30
27
/// E.g. bucket_size at creation time .
31
28
type InitConfig ;
46
43
///
47
44
/// This structure is parametrized by an `Operation` that indicates how
48
45
/// updates to the underlying value trackers should be performed.
49
- pub ( crate ) struct ValueMap < T , A >
46
+ pub ( crate ) struct ValueMap < A >
50
47
where
51
- T : Number ,
52
- A : Aggregator < T > ,
48
+ A : Aggregator ,
53
49
{
54
50
/// Trackers store the values associated with different attribute sets.
55
51
trackers : RwLock < HashMap < Vec < KeyValue > , Arc < A > > > ,
63
59
config : A :: InitConfig ,
64
60
}
65
61
66
- impl < T , A > ValueMap < T , A >
62
+ impl < A > ValueMap < A >
67
63
where
68
- T : Number ,
69
- A : Aggregator < T > ,
64
+ A : Aggregator ,
70
65
{
71
66
fn new ( config : A :: InitConfig ) -> Self {
72
67
ValueMap {
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ use std::{
11
11
12
12
/// Summarizes a set of pre-computed sums as their arithmetic sum.
13
13
pub ( crate ) struct PrecomputedSum < T : Number > {
14
- value_map : ValueMap < T , Assign < T > > ,
14
+ value_map : ValueMap < Assign < T > > ,
15
15
monotonic : bool ,
16
16
start : Mutex < SystemTime > ,
17
17
reported : Mutex < HashMap < Vec < KeyValue > , T > > ,
Original file line number Diff line number Diff line change 17
17
value : T :: AtomicTracker ,
18
18
}
19
19
20
- impl < T > Aggregator < T > for Increment < T >
20
+ impl < T > Aggregator for Increment < T >
21
21
where
22
22
T : Number ,
23
23
{
37
37
38
38
/// Summarizes a set of measurements made as their arithmetic sum.
39
39
pub ( crate ) struct Sum < T : Number > {
40
- value_map : ValueMap < T , Increment < T > > ,
40
+ value_map : ValueMap < Increment < T > > ,
41
41
monotonic : bool ,
42
42
start : Mutex < SystemTime > ,
43
43
}
You can’t perform that action at this time.
0 commit comments