[time] Add httpsdate metrics

Adds metrics that measure the performace and validate assumptions
around the HTTPSDate time source.

Bug: 56841

Change-Id: I633a2c57095c45bde98298e8d5e2fb82a01003ff
Reviewed-on: https://fuchsia-review.googlesource.com/c/cobalt-registry/+/439656
Reviewed-by: Zach Bush <zmbush@google.com>
Reviewed-by: Jody Sankey <jsankey@google.com>
Privacy-Approval: Zach Bush <zmbush@google.com>
Commit-Queue: Satsuki Ueno <satsukiu@google.com>
diff --git a/fuchsia/time/metrics.yaml b/fuchsia/time/metrics.yaml
index 253d94b..2dad150 100644
--- a/fuchsia/time/metrics.yaml
+++ b/fuchsia/time/metrics.yaml
@@ -142,4 +142,57 @@
   meta_data:
     max_release_stage: GA
     expiration_date: "2021/08/17"
-
+################################################################################
+# HTTPSDate time source poll latency
+#
+# Round trip times observed while polling a server in ms.
+################################################################################
+- id: 4
+  metric_name: httpsdate_poll_latency
+  metric_type: INT_HISTOGRAM
+  int_buckets:
+    linear:
+      floor: 0
+      num_buckets: 50 # 1000 ms
+      step_size: 20 # 20 ms
+  reports:
+    - report_name: latency_histogram
+      id: 1
+      report_type: INT_RANGE_HISTOGRAM
+      system_profile_field: [BOARD_NAME, PRODUCT_NAME, SYSTEM_VERSION, CHANNEL]
+  meta_data:
+    max_release_stage: GA
+    expiration_date: "2021/10/15"
+################################################################################
+# HTTPSDate time source bound size
+#
+# Size of the final bounds produced for a single sample in ms. Serves as a
+# measure of the accuracy achieved by HTTPSDate.
+################################################################################
+- id: 5
+  metric_name: httpsdate_bound_size
+  metric_type: EVENT_COUNT
+  metric_dimensions:
+    - dimension: phase
+      event_codes:
+        0: Initial
+        1: Converge
+        2: Maintain
+  reports:
+    - report_name: bound_size_percentiles
+      id: 1
+      report_type: NUMERIC_AGGREGATION
+      percentiles: [50, 90, 95, 99]
+      system_profile_field: [BOARD_NAME, PRODUCT_NAME, SYSTEM_VERSION, CHANNEL]
+    - report_name: bound_size_histogram
+      id: 2
+      report_type: INT_RANGE_HISTOGRAM
+      int_buckets:
+        linear:
+          floor: 0
+          num_buckets: 40 # 2000 ms
+          step_size: 50 # 50 ms
+      system_profile_field: [BOARD_NAME, PRODUCT_NAME, SYSTEM_VERSION, CHANNEL]
+  meta_data:
+    max_release_stage: GA
+    expiration_date: "2021/10/15"