1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct CpuStats {
#[serde(rename = "SystemMode", skip_serializing_if = "Option::is_none")]
pub system_mode: Option<f64>,
#[serde(rename = "UserMode", skip_serializing_if = "Option::is_none")]
pub user_mode: Option<f64>,
#[serde(rename = "TotalTicks", skip_serializing_if = "Option::is_none")]
pub total_ticks: Option<f64>,
#[serde(rename = "ThrottledPeriods", skip_serializing_if = "Option::is_none")]
pub throttled_periods: Option<i32>,
#[serde(rename = "ThrottledTime", skip_serializing_if = "Option::is_none")]
pub throttled_time: Option<i32>,
#[serde(rename = "Percent", skip_serializing_if = "Option::is_none")]
pub percent: Option<f64>,
#[serde(rename = "Measured", skip_serializing_if = "Option::is_none")]
pub measured: Option<Vec<String>>,
}
impl CpuStats {
pub fn new() -> CpuStats {
CpuStats {
system_mode: None,
user_mode: None,
total_ticks: None,
throttled_periods: None,
throttled_time: None,
percent: None,
measured: None,
}
}
}