Skip to content

Commit

Permalink
fix error handling and remove background threads
Browse files Browse the repository at this point in the history
  • Loading branch information
realbigsean committed Feb 11, 2021
1 parent 9e7a6b7 commit ae8b61a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 16 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 23 additions & 15 deletions common/warp_utils/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,27 @@ pub fn scrape_health_metrics() {
set_float_gauge(&SYSTEM_LOADAVG_15, health.sys_loadavg_15);
}

epoch::advance().unwrap();
let allocated = stats::allocated::read().unwrap();
let resident = stats::resident::read().unwrap();
let mapped = stats::mapped::read().unwrap();
let metadata = stats::metadata::read().unwrap();
let retained = stats::retained::read().unwrap();
let active = stats::active::read().unwrap();
let narenas = arenas::narenas::read().unwrap();
set_gauge(&JEMALLOC_ALLOCATED, allocated as i64);
set_gauge(&JEMALLOC_RESIDENT, resident as i64);
set_gauge(&JEMALLOC_MAPPED, mapped as i64);
set_gauge(&JEMALLOC_METADATA, metadata as i64);
set_gauge(&JEMALLOC_RETAINED, retained as i64);
set_gauge(&JEMALLOC_ACTIVE, active as i64);
set_gauge(&JEMALLOC_ARENAS, narenas as i64);
if epoch::advance().is_ok(){
if let Ok(allocated) = stats::allocated::read() {
set_gauge(&JEMALLOC_ALLOCATED, allocated as i64);
}
if let Ok(resident) = stats::resident::read() {
set_gauge(&JEMALLOC_RESIDENT, resident as i64);
}
if let Ok(mapped) = stats::mapped::read() {
set_gauge(&JEMALLOC_MAPPED, mapped as i64);
}
if let Ok(metadata) = stats::metadata::read() {
set_gauge(&JEMALLOC_METADATA, metadata as i64);
}
if let Ok(retained) = stats::retained::read() {
set_gauge(&JEMALLOC_RETAINED, retained as i64);
}
if let Ok(active) = stats::active::read() {
set_gauge(&JEMALLOC_ACTIVE, active as i64);
}
if let Ok(narenas) = arenas::narenas::read() {
set_gauge(&JEMALLOC_ARENAS, narenas as i64);
}
}
}

0 comments on commit ae8b61a

Please sign in to comment.