mirror of
https://github.com/rustfs/rustfs.git
synced 2026-09-01 09:48:20 +00:00
fix(obs): clarify cluster bucket usage metrics (#5081)
Co-authored-by: Henry Guo <marshawcoco@users.noreply.github.com>
This commit is contained in:
@@ -19,21 +19,21 @@ use std::sync::LazyLock;
|
||||
|
||||
const BUCKET_LABEL: &str = "bucket";
|
||||
|
||||
/// Total bytes used by the bucket
|
||||
/// Cluster-wide logical bytes used by the bucket.
|
||||
pub static BUCKET_USAGE_BYTES_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
||||
new_gauge_md(
|
||||
MetricName::Custom("usage_bytes".to_string()),
|
||||
"Total bytes used by the bucket",
|
||||
"Cluster-wide logical bytes used by the bucket",
|
||||
&[BUCKET_LABEL],
|
||||
MetricSubsystem::new("/bucket/usage"),
|
||||
)
|
||||
});
|
||||
|
||||
/// Total number of objects in the bucket
|
||||
/// Cluster-wide logical object count in the bucket.
|
||||
pub static BUCKET_OBJECTS_TOTAL_MD: LazyLock<MetricDescriptor> = LazyLock::new(|| {
|
||||
new_gauge_md(
|
||||
MetricName::Custom("objects_total".to_string()),
|
||||
"Total number of objects in the bucket",
|
||||
"Cluster-wide logical object count in the bucket",
|
||||
&[BUCKET_LABEL],
|
||||
MetricSubsystem::new("/bucket/usage"),
|
||||
)
|
||||
@@ -58,5 +58,7 @@ mod tests {
|
||||
assert_eq!(BUCKET_USAGE_BYTES_MD.subsystem.path(), "/bucket/usage");
|
||||
assert_eq!(BUCKET_OBJECTS_TOTAL_MD.subsystem.path(), "/bucket/usage");
|
||||
assert_eq!(BUCKET_QUOTA_BYTES_MD.subsystem.path(), "/bucket/usage");
|
||||
assert!(BUCKET_USAGE_BYTES_MD.help.contains("Cluster-wide logical"));
|
||||
assert!(BUCKET_OBJECTS_TOTAL_MD.help.contains("Cluster-wide logical"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user