Skip to content

Commit 7a3b8c2

Browse files
Merge pull request #72 from Uniswap/lock-metrics
chore: add key metrics in dutch executor
2 parents 2784e94 + 496fde8 commit 7a3b8c2

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

src/executors/dutch_executor.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,30 @@ impl Executor<SubmitTxToMempool> for DutchExecutor {
6868
send_metric!(metric_future);
6969
}
7070

71+
// send keystore metrics
72+
let keys_in_use = self.key_store.get_keys_in_use();
73+
let keys_available = self.key_store.get_keys_available();
74+
75+
let keys_in_use_future = build_metric_future(
76+
self.cloudwatch_client.clone(),
77+
DimensionValue::V3Executor,
78+
CwMetrics::KeysInUse(chain_id),
79+
keys_in_use as f64,
80+
);
81+
if let Some(metric_future) = keys_in_use_future {
82+
send_metric!(metric_future);
83+
}
84+
85+
let keys_available_future = build_metric_future(
86+
self.cloudwatch_client.clone(),
87+
DimensionValue::V3Executor,
88+
CwMetrics::KeysAvailable(chain_id),
89+
keys_available as f64,
90+
);
91+
if let Some(metric_future) = keys_available_future {
92+
send_metric!(metric_future);
93+
}
94+
7195
// Acquire a key from the key store
7296
let (addr, private_key) = self
7397
.key_store

src/executors/priority_executor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ impl Executor<SubmitTxToMempoolWithExecutionMetadata> for PriorityExecutor {
294294
if let Some(metric_future) = metric_future {
295295
send_metric_with_order_hash!(&order_hash, metric_future);
296296
}
297-
// send keystore metrics in the background
297+
// send keystore metrics
298298
let keys_in_use = self.key_store.get_keys_in_use();
299299
let keys_available = self.key_store.get_keys_available();
300300

0 commit comments

Comments
 (0)