Skip to content

Commit 59364ff

Browse files
committed
Add bundle and operation counters
1 parent 5cb0efb commit 59364ff

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

linera-core/src/worker.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ mod metrics {
8080
pub static TRANSACTION_COUNT: LazyLock<IntCounterVec> =
8181
LazyLock::new(|| register_int_counter_vec("transaction_count", "Transaction count", &[]));
8282

83+
pub static INCOMING_BUNDLE_COUNT: LazyLock<IntCounter> =
84+
LazyLock::new(|| register_int_counter("incoming_bundle_count", "Incoming bundle count"));
85+
86+
pub static OPERATION_COUNT: LazyLock<IntCounter> =
87+
LazyLock::new(|| register_int_counter("operation_count", "Operation count"));
88+
8389
pub static NUM_BLOCKS: LazyLock<IntCounterVec> = LazyLock::new(|| {
8490
register_int_counter_vec("num_blocks", "Number of blocks added to chains", &[])
8591
});
@@ -977,6 +983,8 @@ where
977983
certificate.round.type_name(),
978984
certificate.round.number(),
979985
certificate.block().body.transactions.len() as u64,
986+
certificate.block().body.incoming_bundles().count() as u64,
987+
certificate.block().body.operations().count() as u64,
980988
certificate
981989
.signatures()
982990
.iter()
@@ -996,6 +1004,8 @@ where
9961004
round_type,
9971005
round_number,
9981006
confirmed_transactions,
1007+
confirmed_incoming_bundles,
1008+
confirmed_operations,
9991009
validators_with_signatures,
10001010
) = metrics_data;
10011011
metrics::NUM_BLOCKS.with_label_values(&[]).inc();
@@ -1006,6 +1016,12 @@ where
10061016
metrics::TRANSACTION_COUNT
10071017
.with_label_values(&[])
10081018
.inc_by(confirmed_transactions);
1019+
if confirmed_incoming_bundles > 0 {
1020+
metrics::INCOMING_BUNDLE_COUNT.inc_by(confirmed_incoming_bundles);
1021+
}
1022+
if confirmed_operations > 0 {
1023+
metrics::OPERATION_COUNT.inc_by(confirmed_operations);
1024+
}
10091025
}
10101026

10111027
for validator_name in validators_with_signatures {

0 commit comments

Comments
 (0)