Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add write batch metrics #827

Merged
merged 3 commits into from
Apr 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions analytic_engine/src/table/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ lazy_static! {
)
.unwrap();

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

Expand Down Expand Up @@ -164,7 +165,7 @@ impl Metrics {

#[inline]
pub fn on_write_request_done(&self, num_rows: usize) {
TABLE_WRITE_ROWS_COUNTER.inc_by(num_rows as u64);
TABLE_WRITE_BATCH_HISTGRAM.observe(num_rows as f64);
}

#[inline]
Expand Down