Skip to content

Commit b0cdf2e

Browse files
authored
chore: add write batch metrics (apache#827)
* chore: add write batch metrics * fix CI * fix CR
1 parent a491b74 commit b0cdf2e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

analytic_engine/src/table/metrics.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ lazy_static! {
2929
)
3030
.unwrap();
3131

32-
static ref TABLE_WRITE_ROWS_COUNTER: IntCounter = register_int_counter!(
33-
"table_write_rows_counter",
34-
"Number of rows wrote to table"
32+
static ref TABLE_WRITE_BATCH_HISTGRAM: Histogram = register_histogram!(
33+
"table_write_batch_size",
34+
"Histgram of write batch size",
35+
vec![10.0, 50.0, 100.0, 500.0, 1000.0, 5000.0]
3536
)
3637
.unwrap();
3738

@@ -164,7 +165,7 @@ impl Metrics {
164165

165166
#[inline]
166167
pub fn on_write_request_done(&self, num_rows: usize) {
167-
TABLE_WRITE_ROWS_COUNTER.inc_by(num_rows as u64);
168+
TABLE_WRITE_BATCH_HISTGRAM.observe(num_rows as f64);
168169
}
169170

170171
#[inline]

0 commit comments

Comments
 (0)