mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-25 09:25:46 +00:00
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:
@@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user