srum_core/energy.rs
1//! Energy usage record — battery charge and process energy consumption.
2//!
3//! Source table: `{FEE4E14F-02A9-4550-B5CE-5FA2DA202E37}` in SRUDB.dat.
4
5use chrono::{DateTime, Utc};
6use serde::{Deserialize, Serialize};
7
8/// One SRUM energy usage record: battery state and energy consumed per process.
9///
10/// Forensic value: correlates process activity with battery drain timeline;
11/// timestamps power-on/off cycles; detects anomalous overnight power usage.
12#[derive(Debug, Clone, Serialize, Deserialize)]
13pub struct EnergyUsageRecord {
14 /// Integer ID of the application (look up in [`crate::IdMapEntry`]).
15 pub app_id: i32,
16 /// Integer ID of the user account (look up in [`crate::IdMapEntry`]).
17 pub user_id: i32,
18 /// UTC timestamp of the measurement interval start.
19 pub timestamp: DateTime<Utc>,
20 /// Remaining battery charge at interval end (mWh).
21 pub charge_level: u64,
22 /// Energy consumed by this process in the interval (mWh).
23 pub energy_consumed: u64,
24 /// ESE page number used as AutoIncId proxy for gap detection.
25 /// Gaps in this sequence indicate deleted records (anti-forensics).
26 /// Not serialised to JSON output.
27 #[serde(skip)]
28 pub auto_inc_id: u32,
29}