Skip to content

Commit

Permalink
single_value -> single_value_gauge
Browse files Browse the repository at this point in the history
Signed-off-by: Brian L. Troutwine <[email protected]>
  • Loading branch information
blt committed Feb 13, 2025
1 parent 8e63a80 commit e1c7fe4
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lading/src/observer/linux/cgroup/v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,11 @@ pub(crate) async fn poll(file_path: &Path, labels: &[(String, String)]) -> Resul
| "memory.oom.group"
| "memory.peak",
) => {
single_value(content, metric_prefix, labels);
single_value_gauge(
content,
metric_prefix,
labels,
);
}
Some(
"cpu.pressure" | "io.pressure"
Expand Down Expand Up @@ -189,7 +193,11 @@ pub(crate) async fn poll(file_path: &Path, labels: &[(String, String)]) -> Resul
}

#[inline]
pub(crate) fn single_value(content: &str, metric_prefix: String, labels: &[(String, String)]) {
pub(crate) fn single_value_gauge(
content: &str,
metric_prefix: String,
labels: &[(String, String)],
) {
// Content is a single-value file with an integer value.
if content == "max" {
gauge!(metric_prefix, labels).set(f64::MAX);
Expand Down

0 comments on commit e1c7fe4

Please sign in to comment.