[time][cobalt] Replace metric for frequency estimate.

Cobalt rust bindings define event count as a signed integer but in
[the protobuf][1] its an unsigned integer. This is leading to corruption
in the existing frequency metrics.

This CL adds a replacement metric that avoids negative numbers, then I'll
change the client code, then I'll remove the original metric.

[1]: https://fuchsia.googlesource.com/cobalt/+/refs/heads/master/src/registry/metric_definition.proto

Bug: 75277
Change-Id: I84745d193e1454c910ca9cfb6f1c08f9b879cf30
Reviewed-on: https://fuchsia-review.googlesource.com/c/cobalt-registry/+/519127
Commit-Queue: Jody Sankey <jsankey@google.com>
Reviewed-by: Zach Bush <zmbush@google.com>
Privacy-Approval: Zach Bush <zmbush@google.com>
diff --git a/fuchsia/time/metrics.yaml b/fuchsia/time/metrics.yaml
index e72cad9..678755b 100644
--- a/fuchsia/time/metrics.yaml
+++ b/fuchsia/time/metrics.yaml
@@ -542,6 +542,10 @@
 ################################################################################
 # Timekeeper frequency estimates, as a parts per million deviation.
 #
+# NOTE: THESE METRICS SUFFERED FROM A SIGNED/UNSIGNED MISMATCH IN THE COBALT
+# DEFINITIONS AND THEIR DATA IS CORRUPTED. THEY WILL BE REMOVED ONCE ALL DEVICES
+# HAVE SUCCESSFULLY MIGRATED TO THE REPLACEMENT METRICS BELOW.
+#
 # Records a change to the estimated local oscillator frequency as calculated by
 # Timekeeper for a particular time track. Values are expressed as a ppm
 # deviation from the nominal one utc nanosecond per monotonic nanosecond, with
@@ -608,6 +612,63 @@
   meta_data:
     max_release_stage: GA
     expiration_date: "2022/03/15"
+#
+################################################################################
+# Timekeeper frequency estimates, as an absolute parts per million rate.
+#
+# Records a change to the estimated local oscillator frequency as calculated by
+# Timekeeper for a particular time track. Values are expressed as utc parts
+# per million monotonic parts, with 1,000,000 representing an oscillator that is
+# running at exactly 1Hz. A value over 1,000,000 would indicate UTC is ticking
+# faster than monotonic, i.e. Timekeeper is compensating for an oscillator that
+# is running slow.
+################################################################################
+- id: 23
+  replacement_metric_id: 24
+  metric_name: timekeeper_frequency_abs_estimate
+  metric_type: EVENT_COUNT
+  metric_dimensions: *tfe_dimensions
+  reports:
+    - report_name: percentiles
+      id: 1
+      report_type: NUMERIC_AGGREGATION
+      percentiles: [1, 5, 10, 50, 90, 95, 99]
+      system_profile_field: [BOARD_NAME, PRODUCT_NAME, SYSTEM_VERSION, CHANNEL]
+    - report_name: histogram
+      id: 2
+      report_type: INT_RANGE_HISTOGRAM
+      int_buckets: &tfe_buckets
+        linear:
+          floor: 999800
+          num_buckets: 400
+          step_size: 1
+      system_profile_field: [BOARD_NAME, PRODUCT_NAME, SYSTEM_VERSION, CHANNEL]
+  meta_data:
+    max_release_stage: GA
+    expiration_date: "2022/04/22"
+
+- id: 24
+  metric_name: timekeeper_frequency_abs_estimate_migrated
+  metric_type: INTEGER
+  metric_units_other: ppm
+  metric_semantics: [OUTSIDE_ENVIRONMENT]
+  metric_dimensions: *tfe_dimensions
+  reports:
+    - report_name: hourly_device_average
+      id: 1
+      report_type: HOURLY_VALUE_NUMERIC_STATS
+      local_aggregation_procedure: MEAN
+      privacy_level: NO_ADDED_PRIVACY
+      system_profile_field: [BOARD_NAME, PRODUCT_NAME, SYSTEM_VERSION, CHANNEL]
+    - report_name: histogram
+      id: 2
+      report_type: FLEETWIDE_HISTOGRAMS
+      int_buckets: *tfe_buckets
+      privacy_level: NO_ADDED_PRIVACY
+      system_profile_field: [BOARD_NAME, PRODUCT_NAME, SYSTEM_VERSION, CHANNEL]
+  meta_data:
+    max_release_stage: GA
+    expiration_date: "2022/04/22"
 ################################################################################
 # Timekeeper monitor to primary difference, in microseconds.
 #