-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(metrics): Move table size metric into lib
Query optimization will soon need this metric. Therefore it must be moved out of core and into lib. Eventually we might want to move all metrics into lib.
- Loading branch information
1 parent
4b9f30f
commit 89b2864
Showing
8 changed files
with
34 additions
and
16 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
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
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,16 @@ | ||
use once_cell::sync::Lazy; | ||
use prometheus::IntGaugeVec; | ||
use spacetimedb_lib::Address; | ||
use spacetimedb_metrics::metrics_group; | ||
|
||
metrics_group!( | ||
#[non_exhaustive] | ||
pub struct Metrics { | ||
#[name = spacetime_num_table_rows] | ||
#[help = "The number of rows in a table"] | ||
#[labels(db: Address, table_id: u32)] | ||
pub rdb_num_table_rows: IntGaugeVec, | ||
} | ||
); | ||
|
||
pub static METRICS: Lazy<Metrics> = Lazy::new(Metrics::new); |