@@ -8,15 +8,12 @@ pub mod service {
8
8
9
9
use crate :: {
10
10
fees:: { Api , Fees } ,
11
- state_committer:: SmaPeriods ,
12
11
Result , Runner ,
13
12
} ;
14
13
15
14
#[ derive( Debug , Clone ) ]
16
15
struct FeeMetrics {
17
16
current : IntGauge ,
18
- short : IntGauge ,
19
- long : IntGauge ,
20
17
}
21
18
22
19
impl Default for FeeMetrics {
@@ -27,40 +24,19 @@ pub mod service {
27
24
) )
28
25
. expect ( "metric config to be correct" ) ;
29
26
30
- let short = IntGauge :: with_opts ( Opts :: new (
31
- "short_term_blob_tx_fee" ,
32
- "The short term fee for a transaction with 6 blobs" ,
33
- ) )
34
- . expect ( "metric config to be correct" ) ;
35
-
36
- let long = IntGauge :: with_opts ( Opts :: new (
37
- "long_term_blob_tx_fee" ,
38
- "The long term fee for a transaction with 6 blobs" ,
39
- ) )
40
- . expect ( "metric config to be correct" ) ;
41
-
42
- Self {
43
- current,
44
- short,
45
- long,
46
- }
27
+ Self { current }
47
28
}
48
29
}
49
30
50
31
impl < P > RegistersMetrics for FeeMetricsTracker < P > {
51
32
fn metrics ( & self ) -> Vec < Box < dyn Collector > > {
52
- vec ! [
53
- Box :: new( self . metrics. current. clone( ) ) ,
54
- Box :: new( self . metrics. short. clone( ) ) ,
55
- Box :: new( self . metrics. long. clone( ) ) ,
56
- ]
33
+ vec ! [ Box :: new( self . metrics. current. clone( ) ) ]
57
34
}
58
35
}
59
36
60
37
#[ derive( Clone ) ]
61
38
pub struct FeeMetricsTracker < P > {
62
39
fee_provider : P ,
63
- sma_periods : SmaPeriods ,
64
40
metrics : FeeMetrics ,
65
41
}
66
42
@@ -83,10 +59,9 @@ pub mod service {
83
59
}
84
60
85
61
impl < P > FeeMetricsTracker < P > {
86
- pub fn new ( fee_provider : P , sma_periods : SmaPeriods ) -> Self {
62
+ pub fn new ( fee_provider : P ) -> Self {
87
63
Self {
88
64
fee_provider,
89
- sma_periods,
90
65
metrics : FeeMetrics :: default ( ) ,
91
66
}
92
67
}
@@ -106,12 +81,8 @@ pub mod service {
106
81
} ;
107
82
108
83
let current = tx_fees_for_last_n_blocks ( 1 . try_into ( ) . expect ( "not zero" ) ) . await ?;
109
- let short_term = tx_fees_for_last_n_blocks ( self . sma_periods . short ) . await ?;
110
- let long_term = tx_fees_for_last_n_blocks ( self . sma_periods . long ) . await ?;
111
84
112
85
self . metrics . current . set ( current) ;
113
- self . metrics . short . set ( short_term) ;
114
- self . metrics . long . set ( long_term) ;
115
86
116
87
Ok ( ( ) )
117
88
}
0 commit comments