power_manager_metrics/
power_manager_metrics.rs

1// This file was generated by Cobalt's Registry parser based on the registry YAML
2// in the cobalt_config repository. Edit the YAML there to make changes.
3pub 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
9// Linear bucket constants for power_broker_inspect_vmo_used_bytes per_device_daily_histogram_max
10pub 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
14// Linear bucket constants for power_broker_inspect_vmo_used_per_ten_k per_device_daily_histogram_max
15pub 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
19// Linear bucket constants for power_broker_inspect_event_buffer_capacity per_device_daily_min
20pub 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
24// Linear bucket constants for power_broker_inspect_event_history_duration_seconds per_device_daily_histogram_min
25pub 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
29// Linear bucket constants for raw_temperature_migrated
30pub 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
34// Linear bucket constants for min_power_consumption
35pub 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
39// Linear bucket constants for max_power_consumption
40pub 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
44// Linear bucket constants for avg_power_consumption
45pub 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
49// Linear bucket constants for median_power_consumption
50pub 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
54// Metric ID Constants
55// power_broker_inspect_vmo_used_bytes
56pub const POWER_BROKER_INSPECT_VMO_USED_BYTES_METRIC_ID: u32 = 7;
57// power_broker_inspect_vmo_used_per_ten_k
58pub const POWER_BROKER_INSPECT_VMO_USED_PER_TEN_K_METRIC_ID: u32 = 8;
59// power_broker_inspect_event_buffer_capacity
60pub const POWER_BROKER_INSPECT_EVENT_BUFFER_CAPACITY_METRIC_ID: u32 = 9;
61// power_broker_inspect_event_history_duration
62pub const POWER_BROKER_INSPECT_EVENT_HISTORY_DURATION_METRIC_ID: u32 = 10;
63// power_broker_inspect_event_history_duration_seconds
64pub const POWER_BROKER_INSPECT_EVENT_HISTORY_DURATION_SECONDS_METRIC_ID: u32 = 11;
65// thermal_limit_result_migrated
66pub const THERMAL_LIMIT_RESULT_MIGRATED_METRIC_ID: u32 = 105;
67// raw_temperature_migrated
68pub const RAW_TEMPERATURE_MIGRATED_METRIC_ID: u32 = 106;
69// min_power_consumption
70pub const MIN_POWER_CONSUMPTION_METRIC_ID: u32 = 1004;
71// max_power_consumption
72pub const MAX_POWER_CONSUMPTION_METRIC_ID: u32 = 1005;
73// avg_power_consumption
74pub const AVG_POWER_CONSUMPTION_METRIC_ID: u32 = 1006;
75// median_power_consumption
76pub const MEDIAN_POWER_CONSUMPTION_METRIC_ID: u32 = 1007;
77
78// Enum for power (Metric Dimension result)
79#[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}
90// Alias for thermal_limit_result_migrated (Metric Dimension result) which has the same event codes
91pub use PowerMetricDimensionResult as ThermalLimitResultMigratedMetricDimensionResult;
92
93// Enum for power (Metric Dimension sensor)
94#[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}
105// Alias for raw_temperature_migrated (Metric Dimension sensor) which has the same event codes
106pub use PowerMetricDimensionSensor as RawTemperatureMigratedMetricDimensionSensor;
107
108// Enum for power (Metric Dimension sensor_target)
109#[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}
121// Alias for min_power_consumption (Metric Dimension sensor_target) which has the same event codes
122pub use PowerMetricDimensionSensorTarget as MinPowerConsumptionMetricDimensionSensorTarget;
123
124// Alias for max_power_consumption (Metric Dimension sensor_target) which has the same event codes
125pub use PowerMetricDimensionSensorTarget as MaxPowerConsumptionMetricDimensionSensorTarget;
126
127// Alias for avg_power_consumption (Metric Dimension sensor_target) which has the same event codes
128pub use PowerMetricDimensionSensorTarget as AvgPowerConsumptionMetricDimensionSensorTarget;
129
130// Alias for median_power_consumption (Metric Dimension sensor_target) which has the same event codes
131pub use PowerMetricDimensionSensorTarget as MedianPowerConsumptionMetricDimensionSensorTarget;
132
133// Enum for power (Metric Dimension idleness)
134#[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}
146// Alias for min_power_consumption (Metric Dimension idleness) which has the same event codes
147pub use PowerMetricDimensionIdleness as MinPowerConsumptionMetricDimensionIdleness;
148
149// Alias for max_power_consumption (Metric Dimension idleness) which has the same event codes
150pub use PowerMetricDimensionIdleness as MaxPowerConsumptionMetricDimensionIdleness;
151
152// Alias for avg_power_consumption (Metric Dimension idleness) which has the same event codes
153pub use PowerMetricDimensionIdleness as AvgPowerConsumptionMetricDimensionIdleness;
154
155// Alias for median_power_consumption (Metric Dimension idleness) which has the same event codes
156pub 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}