power_manager_metrics/
power_manager_metrics.rs
1pub mod power_manager_metrics {
4pub const CUSTOMER_NAME: &str = "fuchsia";
5pub const CUSTOMER_ID: u32 = 1;
6pub const PROJECT_NAME: &str = "power";
7pub const PROJECT_ID: u32 = 3;
8
9pub const POWER_BROKER_INSPECT_VMO_USED_BYTES_PER_DEVICE_DAILY_HISTOGRAM_MAX_INT_BUCKETS_FLOOR: i64 = 0;
11pub const POWER_BROKER_INSPECT_VMO_USED_BYTES_PER_DEVICE_DAILY_HISTOGRAM_MAX_INT_BUCKETS_NUM_BUCKETS: u32 = 1024;
12pub const POWER_BROKER_INSPECT_VMO_USED_BYTES_PER_DEVICE_DAILY_HISTOGRAM_MAX_INT_BUCKETS_STEP_SIZE: u32 = 4096;
13
14pub const POWER_BROKER_INSPECT_VMO_USED_PER_TEN_K_PER_DEVICE_DAILY_HISTOGRAM_MAX_INT_BUCKETS_FLOOR: i64 = 0;
16pub const POWER_BROKER_INSPECT_VMO_USED_PER_TEN_K_PER_DEVICE_DAILY_HISTOGRAM_MAX_INT_BUCKETS_NUM_BUCKETS: u32 = 100;
17pub const POWER_BROKER_INSPECT_VMO_USED_PER_TEN_K_PER_DEVICE_DAILY_HISTOGRAM_MAX_INT_BUCKETS_STEP_SIZE: u32 = 100;
18
19pub const POWER_BROKER_INSPECT_EVENT_BUFFER_CAPACITY_PER_DEVICE_DAILY_MIN_INT_BUCKETS_FLOOR: i64 = 1048576;
21pub const POWER_BROKER_INSPECT_EVENT_BUFFER_CAPACITY_PER_DEVICE_DAILY_MIN_INT_BUCKETS_NUM_BUCKETS: u32 = 100;
22pub const POWER_BROKER_INSPECT_EVENT_BUFFER_CAPACITY_PER_DEVICE_DAILY_MIN_INT_BUCKETS_STEP_SIZE: u32 = 262144;
23
24pub const POWER_BROKER_INSPECT_EVENT_HISTORY_DURATION_SECONDS_PER_DEVICE_DAILY_HISTOGRAM_MIN_INT_BUCKETS_FLOOR: i64 = 0;
26pub const POWER_BROKER_INSPECT_EVENT_HISTORY_DURATION_SECONDS_PER_DEVICE_DAILY_HISTOGRAM_MIN_INT_BUCKETS_NUM_BUCKETS: u32 = 288;
27pub const POWER_BROKER_INSPECT_EVENT_HISTORY_DURATION_SECONDS_PER_DEVICE_DAILY_HISTOGRAM_MIN_INT_BUCKETS_STEP_SIZE: u32 = 300;
28
29pub const RAW_TEMPERATURE_MIGRATED_INT_BUCKETS_FLOOR: i64 = 20;
31pub const RAW_TEMPERATURE_MIGRATED_INT_BUCKETS_NUM_BUCKETS: u32 = 80;
32pub const RAW_TEMPERATURE_MIGRATED_INT_BUCKETS_STEP_SIZE: u32 = 1;
33
34pub const MIN_POWER_CONSUMPTION_INT_BUCKETS_FLOOR: i64 = 0;
36pub const MIN_POWER_CONSUMPTION_INT_BUCKETS_NUM_BUCKETS: u32 = 100;
37pub const MIN_POWER_CONSUMPTION_INT_BUCKETS_STEP_SIZE: u32 = 50;
38
39pub const MAX_POWER_CONSUMPTION_INT_BUCKETS_FLOOR: i64 = 0;
41pub const MAX_POWER_CONSUMPTION_INT_BUCKETS_NUM_BUCKETS: u32 = 100;
42pub const MAX_POWER_CONSUMPTION_INT_BUCKETS_STEP_SIZE: u32 = 50;
43
44pub const AVG_POWER_CONSUMPTION_INT_BUCKETS_FLOOR: i64 = 0;
46pub const AVG_POWER_CONSUMPTION_INT_BUCKETS_NUM_BUCKETS: u32 = 100;
47pub const AVG_POWER_CONSUMPTION_INT_BUCKETS_STEP_SIZE: u32 = 50;
48
49pub const MEDIAN_POWER_CONSUMPTION_INT_BUCKETS_FLOOR: i64 = 0;
51pub const MEDIAN_POWER_CONSUMPTION_INT_BUCKETS_NUM_BUCKETS: u32 = 100;
52pub const MEDIAN_POWER_CONSUMPTION_INT_BUCKETS_STEP_SIZE: u32 = 50;
53
54pub const POWER_BROKER_INSPECT_VMO_USED_BYTES_METRIC_ID: u32 = 7;
57pub const POWER_BROKER_INSPECT_VMO_USED_PER_TEN_K_METRIC_ID: u32 = 8;
59pub const POWER_BROKER_INSPECT_EVENT_BUFFER_CAPACITY_METRIC_ID: u32 = 9;
61pub const POWER_BROKER_INSPECT_EVENT_HISTORY_DURATION_METRIC_ID: u32 = 10;
63pub const POWER_BROKER_INSPECT_EVENT_HISTORY_DURATION_SECONDS_METRIC_ID: u32 = 11;
65pub const THERMAL_LIMIT_RESULT_MIGRATED_METRIC_ID: u32 = 105;
67pub const RAW_TEMPERATURE_MIGRATED_METRIC_ID: u32 = 106;
69pub const MIN_POWER_CONSUMPTION_METRIC_ID: u32 = 1004;
71pub const MAX_POWER_CONSUMPTION_METRIC_ID: u32 = 1005;
73pub const AVG_POWER_CONSUMPTION_METRIC_ID: u32 = 1006;
75pub const MEDIAN_POWER_CONSUMPTION_METRIC_ID: u32 = 1007;
77
78#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
80pub enum PowerMetricDimensionResult {
81 Mitigated = 0,
82 Shutdown = 1,
83}
84
85impl cobalt_client::traits::AsEventCode for PowerMetricDimensionResult {
86 fn as_event_code(&self) -> u32 {
87 *self as u32
88 }
89}
90pub use PowerMetricDimensionResult as ThermalLimitResultMigratedMetricDimensionResult;
92
93#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
95pub enum PowerMetricDimensionSensor {
96 Ambient = 0,
97 ThermalPolicyInput1 = 1,
98}
99
100impl cobalt_client::traits::AsEventCode for PowerMetricDimensionSensor {
101 fn as_event_code(&self) -> u32 {
102 *self as u32
103 }
104}
105pub use PowerMetricDimensionSensor as RawTemperatureMigratedMetricDimensionSensor;
107
108#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
110pub enum PowerMetricDimensionSensorTarget {
111 Unknown = 0,
112 Mlb = 1,
113 Audio = 2,
114}
115
116impl cobalt_client::traits::AsEventCode for PowerMetricDimensionSensorTarget {
117 fn as_event_code(&self) -> u32 {
118 *self as u32
119 }
120}
121pub use PowerMetricDimensionSensorTarget as MinPowerConsumptionMetricDimensionSensorTarget;
123
124pub use PowerMetricDimensionSensorTarget as MaxPowerConsumptionMetricDimensionSensorTarget;
126
127pub use PowerMetricDimensionSensorTarget as AvgPowerConsumptionMetricDimensionSensorTarget;
129
130pub use PowerMetricDimensionSensorTarget as MedianPowerConsumptionMetricDimensionSensorTarget;
132
133#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
135pub enum PowerMetricDimensionIdleness {
136 Unknown = 0,
137 Idle = 1,
138 Active = 2,
139}
140
141impl cobalt_client::traits::AsEventCode for PowerMetricDimensionIdleness {
142 fn as_event_code(&self) -> u32 {
143 *self as u32
144 }
145}
146pub use PowerMetricDimensionIdleness as MinPowerConsumptionMetricDimensionIdleness;
148
149pub use PowerMetricDimensionIdleness as MaxPowerConsumptionMetricDimensionIdleness;
151
152pub use PowerMetricDimensionIdleness as AvgPowerConsumptionMetricDimensionIdleness;
154
155pub use PowerMetricDimensionIdleness as MedianPowerConsumptionMetricDimensionIdleness;
157
158#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
159pub struct MinPowerConsumptionEventCodes {
160 pub sensor_target: MinPowerConsumptionMetricDimensionSensorTarget,
161 pub idleness: MinPowerConsumptionMetricDimensionIdleness,
162}
163
164impl cobalt_client::traits::AsEventCodes for MinPowerConsumptionEventCodes {
165 fn as_event_codes(&self) -> Vec<u32> {
166 use cobalt_client::traits::AsEventCode;
167 vec![
168 self.sensor_target.as_event_code(),
169 self.idleness.as_event_code(),
170 ]
171 }
172}
173
174#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
175pub struct MaxPowerConsumptionEventCodes {
176 pub sensor_target: MaxPowerConsumptionMetricDimensionSensorTarget,
177 pub idleness: MaxPowerConsumptionMetricDimensionIdleness,
178}
179
180impl cobalt_client::traits::AsEventCodes for MaxPowerConsumptionEventCodes {
181 fn as_event_codes(&self) -> Vec<u32> {
182 use cobalt_client::traits::AsEventCode;
183 vec![
184 self.sensor_target.as_event_code(),
185 self.idleness.as_event_code(),
186 ]
187 }
188}
189
190#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
191pub struct AvgPowerConsumptionEventCodes {
192 pub sensor_target: AvgPowerConsumptionMetricDimensionSensorTarget,
193 pub idleness: AvgPowerConsumptionMetricDimensionIdleness,
194}
195
196impl cobalt_client::traits::AsEventCodes for AvgPowerConsumptionEventCodes {
197 fn as_event_codes(&self) -> Vec<u32> {
198 use cobalt_client::traits::AsEventCode;
199 vec![
200 self.sensor_target.as_event_code(),
201 self.idleness.as_event_code(),
202 ]
203 }
204}
205
206#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
207pub struct MedianPowerConsumptionEventCodes {
208 pub sensor_target: MedianPowerConsumptionMetricDimensionSensorTarget,
209 pub idleness: MedianPowerConsumptionMetricDimensionIdleness,
210}
211
212impl cobalt_client::traits::AsEventCodes for MedianPowerConsumptionEventCodes {
213 fn as_event_codes(&self) -> Vec<u32> {
214 use cobalt_client::traits::AsEventCode;
215 vec![
216 self.sensor_target.as_event_code(),
217 self.idleness.as_event_code(),
218 ]
219 }
220}
221
222}