-
Notifications
You must be signed in to change notification settings - Fork 232
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
48ad94b
commit ba014ca
Showing
29 changed files
with
406 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
//! Common code for retrieving battery data. | ||
|
||
#[derive(Debug, Clone)] | ||
pub enum State { | ||
Unknown, | ||
Charging, | ||
Discharging, | ||
Empty, | ||
Full, | ||
} | ||
|
||
#[derive(Debug, Clone)] | ||
pub struct BatteryHarvest { | ||
pub charge_percent: f64, | ||
pub secs_until_full: Option<i64>, | ||
pub secs_until_empty: Option<i64>, | ||
pub power_consumption_rate_watts: f64, | ||
pub health_percent: f64, | ||
pub state: State, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
//! Common code for retrieving CPU data. | ||
|
||
#[derive(Debug, Clone, Copy)] | ||
pub(crate) enum CpuDataType { | ||
Avg, | ||
Cpu(usize), | ||
} | ||
|
||
/// Represents a single core/thread and its usage. | ||
#[derive(Debug, Clone)] | ||
pub(crate) struct CpuData { | ||
pub entry_type: CpuDataType, | ||
pub usage: f64, | ||
} | ||
|
||
/// Collected CPU data at an instance. | ||
#[derive(Debug, Clone)] | ||
pub(crate) struct CpuHarvest { | ||
pub usages: Vec<CpuData>, | ||
pub load_average: [f32; 3], | ||
} |
Oops, something went wrong.