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
47
48
49
50
51
52
53
// This file was generated by Cobalt's Registry parser based on the registry YAML
// in the cobalt_config repository. Edit the YAML there to make changes.
pub mod cobalt_registry {
pub const CUSTOMER_NAME: &str = "fuchsia";
pub const CUSTOMER_ID: u32 = 1;
pub const PROJECT_NAME: &str = "recovery";
pub const PROJECT_ID: u32 = 17;

// Linear bucket constants for ota_download_duration histogram
pub const OTA_DOWNLOAD_DURATION_HISTOGRAM_INT_BUCKETS_FLOOR: i64 = 0;
pub const OTA_DOWNLOAD_DURATION_HISTOGRAM_INT_BUCKETS_NUM_BUCKETS: u32 = 100;
pub const OTA_DOWNLOAD_DURATION_HISTOGRAM_INT_BUCKETS_STEP_SIZE: u32 = 15;

// Metric ID Constants
// ota_download_duration
pub const OTA_DOWNLOAD_DURATION_METRIC_ID: u32 = 1;
// ota_download_status
pub const OTA_DOWNLOAD_STATUS_METRIC_ID: u32 = 2;
// recovery_event
pub const RECOVERY_EVENT_METRIC_ID: u32 = 3;

// Enum for ota_download_status (Metric Dimension result)
#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
pub enum OtaDownloadStatusMetricDimensionResult {
  Unknown = 0,
  Success = 1,
  Failure = 2,
}

impl cobalt_client::traits::AsEventCode for OtaDownloadStatusMetricDimensionResult {
  fn as_event_code(&self) -> u32 {
    *self as u32
  }
}

// Enum for recovery_event (Metric Dimension result)
#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]
pub enum RecoveryEventMetricDimensionResult {
  Unknown = 0,
  WiFiConnected = 1,
  OtaStarted = 2,
  OtaSuccess = 3,
  OtaFailed = 4,
  StoragedReprovisioned = 5,
}

impl cobalt_client::traits::AsEventCode for RecoveryEventMetricDimensionResult {
  fn as_event_code(&self) -> u32 {
    *self as u32
  }
}

}