pvf: Log memory metrics from preparation (#6565)

* Add getrusage and memory tracker for precheck preparation

* Log memory stats metrics after prechecking

* Fix tests

* Try to fix errors (linux-only so I'm relying on CI here)

* Try to fix CI

* Add module docs for `prepare/memory_stats.rs`; fix CI error

* Report memory stats for all preparation jobs

* Use `RUSAGE_SELF` instead of `RUSAGE_THREAD`

Not sure why I did that -- was a brainfart on my end.

* Revert last commit (RUSAGE_THREAD is correct)

* Use exponential buckets

* Use `RUSAGE_SELF` for `getrusage`; enable `max_rss` metric for MacOS

* Increase poll interval

* Revert "Use `RUSAGE_SELF` for `getrusage`; enable `max_rss` metric for MacOS"

This reverts commit becf7a815409ab530fc61370abffcd1b97b9a777.
This commit is contained in:
Marcin S
2023-02-06 12:17:21 +01:00
committed by GitHub
parent e3930760e8
commit f317115b99
11 changed files with 470 additions and 59 deletions
+4 -4
View File
@@ -36,8 +36,8 @@ impl MemoryAllocationTracker {
// update stats by advancing the allocation epoch
self.epoch.advance()?;
let allocated: u64 = self.allocated.read()? as _;
let resident: u64 = self.resident.read()? as _;
let allocated = self.allocated.read()?;
let resident = self.resident.read()?;
Ok(MemoryAllocationSnapshot { allocated, resident })
}
}
@@ -47,7 +47,7 @@ impl MemoryAllocationTracker {
#[derive(Debug, Clone)]
pub struct MemoryAllocationSnapshot {
/// Total resident memory, in bytes.
pub resident: u64,
pub resident: usize,
/// Total allocated memory, in bytes.
pub allocated: u64,
pub allocated: usize,
}