Skip to main content

srum_core/
app_usage.rs

1//! Application resource usage record — CPU cycles, foreground/background time.
2//!
3//! Source table: `{5C8CF1C7-7257-4F13-B223-970EF5939312}` in SRUDB.dat.
4
5use chrono::{DateTime, Utc};
6use serde::{Deserialize, Serialize};
7
8/// One SRUM application resource usage record: CPU cycle counts for
9/// foreground and background execution per ~1-hour interval.
10#[derive(Debug, Clone, Serialize, Deserialize)]
11pub struct AppUsageRecord {
12    /// Integer ID of the application (look up in [`crate::IdMapEntry`]).
13    pub app_id: i32,
14    /// Integer ID of the user account.
15    pub user_id: i32,
16    /// UTC timestamp of the measurement interval start.
17    pub timestamp: DateTime<Utc>,
18    /// CPU cycles consumed while the application was in the foreground.
19    pub foreground_cycles: u64,
20    /// CPU cycles consumed while the application was in the background.
21    pub background_cycles: u64,
22    /// ESE page number used as AutoIncId proxy for gap detection.
23    /// Gaps in this sequence indicate deleted records (anti-forensics).
24    /// Not serialised to JSON output.
25    #[serde(skip)]
26    pub auto_inc_id: u32,
27}