@@ -62,8 +62,8 @@ pub async fn process_event_with_backoff(
62
62
. inc ( ) ;
63
63
64
64
match success {
65
- Ok ( res ) => {
66
- tracing:: info!( "Processed event successfully in {:?}" , res . duration) ;
65
+ Ok ( result ) => {
66
+ tracing:: info!( "Processed event successfully in {:?}" , result . duration) ;
67
67
68
68
metrics
69
69
. requests_processed_success
@@ -73,39 +73,37 @@ pub async fn process_event_with_backoff(
73
73
metrics
74
74
. request_duration_ms
75
75
. get_or_create ( & account_label)
76
- . observe ( res . duration . as_millis ( ) as f64 ) ;
76
+ . observe ( result . duration . as_millis ( ) as f64 ) ;
77
77
78
78
// Track retry count, gas multiplier, and fee multiplier for successful transactions
79
79
metrics
80
80
. retry_count
81
81
. get_or_create ( & account_label)
82
- . observe ( res . num_retries as f64 ) ;
82
+ . observe ( result . num_retries as f64 ) ;
83
83
84
84
metrics
85
85
. final_gas_multiplier
86
86
. get_or_create ( & account_label)
87
- . observe ( res . gas_multiplier as f64 ) ;
87
+ . observe ( result . gas_multiplier as f64 ) ;
88
88
89
89
metrics
90
90
. final_fee_multiplier
91
91
. get_or_create ( & account_label)
92
- . observe ( res . fee_multiplier as f64 ) ;
92
+ . observe ( result . fee_multiplier as f64 ) ;
93
93
94
- if let Ok ( receipt) = res. receipt {
95
- if let Some ( gas_used) = receipt. gas_used {
96
- let gas_used_float = gas_used. as_u128 ( ) as f64 / 1e18 ;
94
+ if let Some ( gas_used) = result. receipt . gas_used {
95
+ let gas_used_float = gas_used. as_u128 ( ) as f64 / 1e18 ;
96
+ metrics
97
+ . total_gas_spent
98
+ . get_or_create ( & account_label)
99
+ . inc_by ( gas_used_float) ;
100
+
101
+ if let Some ( gas_price) = result. receipt . effective_gas_price {
102
+ let gas_fee = ( gas_used * gas_price) . as_u128 ( ) as f64 / 1e18 ;
97
103
metrics
98
- . total_gas_spent
104
+ . total_gas_fee_spent
99
105
. get_or_create ( & account_label)
100
- . inc_by ( gas_used_float) ;
101
-
102
- if let Some ( gas_price) = receipt. effective_gas_price {
103
- let gas_fee = ( gas_used * gas_price) . as_u128 ( ) as f64 / 1e18 ;
104
- metrics
105
- . total_gas_fee_spent
106
- . get_or_create ( & account_label)
107
- . inc_by ( gas_fee) ;
108
- }
106
+ . inc_by ( gas_fee) ;
109
107
}
110
108
}
111
109
metrics. reveals . get_or_create ( & account_label) . inc ( ) ;
0 commit comments