mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-27 10:20:38 +00:00
feat: Report disk usage stats to metasrv thru heartbeat (#1167)
* feat: Report disk usage stats to metasrv thru heartbeat Signed-off-by: Zheming Li <nkdudu@126.com> * Update src/catalog/src/error.rs Co-authored-by: fys <40801205+Fengys123@users.noreply.github.com> * Update src/catalog/src/lib.rs Co-authored-by: fys <40801205+Fengys123@users.noreply.github.com> * Update src/mito/src/table.rs Co-authored-by: fys <40801205+Fengys123@users.noreply.github.com> --------- Signed-off-by: Zheming Li <nkdudu@126.com> Co-authored-by: fys <40801205+Fengys123@users.noreply.github.com>
This commit is contained in:
@@ -103,6 +103,14 @@ pub trait Table: Send + Sync {
|
||||
async fn close(&self) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Get region stats in this table.
|
||||
fn region_stats(&self) -> Result<Vec<RegionStat>> {
|
||||
UnsupportedSnafu {
|
||||
operation: "REGION_STATS",
|
||||
}
|
||||
.fail()?
|
||||
}
|
||||
}
|
||||
|
||||
pub type TableRef = Arc<dyn Table>;
|
||||
@@ -113,3 +121,9 @@ pub trait TableIdProvider {
|
||||
}
|
||||
|
||||
pub type TableIdProviderRef = Arc<dyn TableIdProvider + Send + Sync>;
|
||||
|
||||
#[derive(Default, Debug)]
|
||||
pub struct RegionStat {
|
||||
pub region_id: u64,
|
||||
pub disk_usage_bytes: u64,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user