Skip to main content

query_runtime/metrics/
memory.rs

1use super::QueryMetrics;
2
3impl QueryMetrics {
4    /// Records a resident DataFrame memory observation in bytes.
5    pub fn record_device_memory_observation(&mut self, bytes: u64) {
6        self.peak_device_memory_bytes = Some(self.peak_device_memory_bytes.map_or(bytes, |peak| peak.max(bytes)));
7        self.resident_dataframe_peak_bytes =
8            Some(self.resident_dataframe_peak_bytes.map_or(bytes, |peak| peak.max(bytes)));
9    }
10
11    /// Records the allocation high-water mark of the attempt's allocation
12    /// domain in bytes. The mark covers every plan of the attempt, not only
13    /// the plan these metrics belong to.
14    pub fn record_allocator_high_water_bytes(&mut self, bytes: u64) {
15        self.allocator_high_water_bytes = Some(self.allocator_high_water_bytes.map_or(bytes, |peak| peak.max(bytes)));
16    }
17}