[local_storage] Add metric for minfs upgrade
This metric will be used to track the progress of an in-place minfs
partition upgrade. The metric is a simple counter (broken down by the
usual dimensions board/product/channel/version) which has several
"stages" which we can use to monitor how often the upgrade is attempted
and how often it completes successfully (by drop-off analysis).
Bug: 84973
Change-Id: If1f38b26577b00970fc712db5d054ab3ef6fbc58
Reviewed-on: https://fuchsia-review.googlesource.com/c/cobalt-registry/+/583543
Commit-Queue: James Sullivan <jfsulliv@google.com>
Reviewed-by: Cameron Dale <camrdale@google.com>
Reviewed-by: Brett Wilson <brettw@google.com>
Privacy-Approval: Cameron Dale <camrdale@google.com>
diff --git a/fuchsia/local_storage/metrics.yaml b/fuchsia/local_storage/metrics.yaml
index 70a8644..026a809 100644
--- a/fuchsia/local_storage/metrics.yaml
+++ b/fuchsia/local_storage/metrics.yaml
@@ -2143,3 +2143,53 @@
meta_data:
max_release_stage: GA
expiration_date: "2022/02/16"
+
+# Temporary Metrics
+# Reserved Range: [9000, 10000)
+
+################################################################################
+# Data partition upgrade
+#
+# Used to track the progress of a one-time data partition upgrade.
+# Each `stage` is triggered as a one-off event when that stage begins, which
+# occurs during boot. Since the overall procedure is intended to be a one-time
+# event, this should only trigger once per device.
+################################################################################
+- id: 9000
+ replacement_metric_id: 9001
+ metric_name: data_partition_upgrade
+ metric_type: EVENT_OCCURRED
+ metric_dimensions: &dpu_buckets
+ - dimension: stage
+ event_codes:
+ 0: Unknown
+ 1: Skipped
+ 2: DetectedFailedUpgrade
+ 3: ReadOldData
+ 4: WriteNewData
+ 5: Done
+ max_event_code: 15
+ reports:
+ - report_name: data_partition_upgrade
+ id: 9000
+ report_type: SIMPLE_OCCURRENCE_COUNT
+ system_profile_field: [BOARD_NAME, PRODUCT_NAME, SYSTEM_VERSION, CHANNEL]
+ local_privacy_noise_level: NONE
+ meta_data:
+ max_release_stage: GA
+ expiration_date: "2022/09/20"
+
+- id: 9001
+ metric_name: data_partition_upgrade_migrated
+ metric_type: OCCURRENCE
+ metric_semantics: [USAGE_COUNTING]
+ metric_dimensions: *dpu_buckets
+ reports:
+ - report_name: data_partition_upgrade
+ id: 1
+ report_type: FLEETWIDE_OCCURRENCE_COUNTS
+ privacy_level: NO_ADDED_PRIVACY
+ system_profile_field: [BOARD_NAME, PRODUCT_NAME, SYSTEM_VERSION, CHANNEL]
+ meta_data:
+ max_release_stage: GA
+ expiration_date: "2022/09/20"