diff --git a/crates/sui-indexer-alt/src/metrics.rs b/crates/sui-indexer-alt/src/metrics.rs index 6df0b58807878..9dec2ff9950f0 100644 --- a/crates/sui-indexer-alt/src/metrics.rs +++ b/crates/sui-indexer-alt/src/metrics.rs @@ -100,6 +100,7 @@ pub struct IndexerMetrics { pub collector_gather_latency: HistogramVec, pub collector_batch_size: HistogramVec, pub committer_commit_latency: HistogramVec, + pub committer_tx_rows: HistogramVec, pub watermark_gather_latency: HistogramVec, pub watermark_commit_latency: HistogramVec, pub watermark_pruner_read_latency: HistogramVec, @@ -400,6 +401,14 @@ impl IndexerMetrics { registry, ) .unwrap(), + committer_tx_rows: register_histogram_vec_with_registry!( + "indexer_committer_tx_rows", + "Number of rows written to the database in a single database transaction by this committer", + &["pipeline"], + BATCH_SIZE_BUCKETS.to_vec(), + registry, + ) + .unwrap(), watermark_gather_latency: register_histogram_vec_with_registry!( "indexer_watermark_gather_latency", "Time taken to calculate the new high watermark after a write by this committer", diff --git a/crates/sui-indexer-alt/src/pipeline/concurrent/committer.rs b/crates/sui-indexer-alt/src/pipeline/concurrent/committer.rs index 1f35e85506752..bec3e25542705 100644 --- a/crates/sui-indexer-alt/src/pipeline/concurrent/committer.rs +++ b/crates/sui-indexer-alt/src/pipeline/concurrent/committer.rs @@ -138,6 +138,11 @@ pub(super) fn committer( .with_label_values(&[H::NAME]) .inc_by(affected as u64); + metrics + .committer_tx_rows + .with_label_values(&[H::NAME]) + .observe(affected as f64); + Ok(()) } }; diff --git a/crates/sui-indexer-alt/src/pipeline/sequential/committer.rs b/crates/sui-indexer-alt/src/pipeline/sequential/committer.rs index 11c0274137844..220efc1237d70 100644 --- a/crates/sui-indexer-alt/src/pipeline/sequential/committer.rs +++ b/crates/sui-indexer-alt/src/pipeline/sequential/committer.rs @@ -285,6 +285,11 @@ pub(super) fn committer( .with_label_values(&[H::NAME]) .inc_by(affected as u64); + metrics + .committer_tx_rows + .with_label_values(&[H::NAME]) + .observe(affected as f64); + metrics .watermark_epoch_in_db .with_label_values(&[H::NAME])