[setui] create new project + add new metric

* F6 version of fxrev.dev/605330 + fxrev.dev/605333

Bug: 88539

Change-Id: I4576a66017b780fe7731d722cf0d9752e3c835f9
Reviewed-on: https://fuchsia-review.googlesource.com/c/cobalt-registry/+/605330
Reviewed-by: Cameron Dale <camrdale@google.com>
Reviewed-by: William Xiao <wxyz@google.com>
Privacy-Approval: Cameron Dale <camrdale@google.com>
Commit-Queue: Francois Rousseau <frousseau@google.com>
(cherry picked from commit ef0e3873ca13877096423539ae71078056d1ac4f)
diff --git a/fuchsia/setui/metrics.yaml b/fuchsia/setui/metrics.yaml
new file mode 100644
index 0000000..e94eae2
--- /dev/null
+++ b/fuchsia/setui/metrics.yaml
@@ -0,0 +1,67 @@
+# Copyright 2021 The Fuchsia Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+################################################################################
+# Cobalt Project: setui
+################################################################################
+
+metric_definitions:
+
+#####################################################################
+# Next Metric ID: 2
+#####################################################################
+
+#####################################################################
+# write_failures
+#
+# Records the number of times a particular setting fails to be
+# written to disk on a given device in a particular day. A new event
+# will be logged every hour via a Sampler config if there is any new
+# failure in that hour.
+#####################################################################
+- id: 1
+  metric_name: write_failures
+  metric_type: OCCURRENCE
+  metric_semantics: [USAGE_COUNTING]
+  metric_dimensions:
+    - dimension: setting
+      event_codes:
+        0: Unknown
+        1: Accessibility
+        2: Audio
+        3: AudioPolicy
+        4: Display
+        5: DoNotDisturb
+        6: FactoryReset
+        7: Input
+        8: Intl
+        9: Light
+        10: NightMode
+        11: Privacy
+        12: Setup
+  reports:
+      #####################################################################
+      # per_device_counts
+      #
+      # Gives a histogram of the number of failures per device, up to 10
+      # failures and then one more 10+ failures bucket. This can be used
+      # to get the number of devices with at least one failure in addition
+      # to the distribution of failures per device.
+      #####################################################################
+    - report_name: per_device_counts
+      id: 1
+      report_type: UNIQUE_DEVICE_HISTOGRAMS
+      # TODO(fxbug.dev/87403): switch to REPORT_ALL once available.
+      system_profile_selection: SELECT_LAST
+      local_aggregation_period: WINDOW_1_DAY
+      int_buckets:
+        linear:
+          floor: 1
+          num_buckets: 10 # past 10 failures a day, it will just be the overflow bucket.
+          step_size: 1
+      privacy_level: NO_ADDED_PRIVACY
+      system_profile_field: [BOARD_NAME, PRODUCT_NAME, SYSTEM_VERSION, CHANNEL]
+  meta_data:
+    max_release_stage: GA
+    expiration_date: "2022/10/31"
diff --git a/projects.yaml b/projects.yaml
index 833a9ee..734de31 100644
--- a/projects.yaml
+++ b/projects.yaml
@@ -26,7 +26,7 @@
 
   # When adding new projects, also make sure to update the internal list of
   # Cobalt projects: go/cobalt-internal-registry-metadata
-  # Next project ID:  16
+  # Next project ID:  17
   projects:
 
 ################################################################################
@@ -123,3 +123,6 @@
     - project_name:    sysmem
       project_id:      15
       project_contact: fuchsia-cobalt-dashboard-owners@google.com
+    - project_name:    setui
+      project_id:      16
+      project_contact: fuchsia-cobalt-dashboard-owners@google.com