-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Open source the system cleanup worker (#30519)
1. Good for cleaning up the session metadata for mutations 2. Will be good to have when we are using it for export expiration which feels more of a product feature. GitOrigin-RevId: 6c5630c765bac8b8915bf6aa1b1644a2d2ce2655
- Loading branch information
1 parent
b1912fa
commit 7bcb6cb
Showing
5 changed files
with
374 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
use metrics::{ | ||
log_counter_with_labels, | ||
prometheus::VMHistogram, | ||
register_convex_counter, | ||
register_convex_histogram, | ||
StaticMetricLabel, | ||
Timer, | ||
}; | ||
use value::TableName; | ||
|
||
register_convex_histogram!( | ||
SYSTEM_TABLE_CLEANUP_SECONDS, | ||
"Duration of system table cleanup" | ||
); | ||
pub fn system_table_cleanup_timer() -> Timer<VMHistogram> { | ||
Timer::new(&SYSTEM_TABLE_CLEANUP_SECONDS) | ||
} | ||
|
||
register_convex_counter!( | ||
SYSTEM_TABLE_CLEANUP_ROWS_TOTAL, | ||
"Number of rows cleaned up in system tables", | ||
&["table"] | ||
); | ||
pub fn log_system_table_cleanup_rows(table_name: &TableName, rows: usize) { | ||
log_counter_with_labels( | ||
&SYSTEM_TABLE_CLEANUP_ROWS_TOTAL, | ||
rows as u64, | ||
vec![StaticMetricLabel::new("table", table_name.to_string())], | ||
) | ||
} |
Oops, something went wrong.