[power] Create power project

Create a new metrics project: power. The initial metrics to collect are:
- thermal_limiting_elapsed_time
- thermal_event_occured
- selected_cpu_p_state
- raw_temperature

Change-Id: I23045344d2059a5035acc31a484b2c2de012c2f1
diff --git a/fuchsia/power/metrics.yaml b/fuchsia/power/metrics.yaml
new file mode 100644
index 0000000..110e899
--- /dev/null
+++ b/fuchsia/power/metrics.yaml
@@ -0,0 +1,150 @@
+# Copyright 2020 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: power
+################################################################################
+
+metric_definitions:
+
+#####################################################################
+# thermal_limiting_elapsed_time
+#
+# Records the duration of a period of thermal limiting (where the
+# thermal load is greater than 0). The duration is reported after
+# a device exits a period of thermal limiting. The `average_cpu_load`
+# dimension provides a hint about the CPU load during the period.
+# The `exit_mode` dimension indicates the mode in which the device
+# exited thermal limiting. The `max_thermal_load` dimension reports
+# the highest thermal load that was experienced during the period.
+#####################################################################
+- id: 1
+  metric_name: thermal_limiting_elapsed_time
+  metric_type: ELAPSED_TIME
+  metric_dimensions:
+    - dimension: average_cpu_load
+      event_codes:
+        0: Below25PercentOfMax
+        1: Below50PercentOfMax
+        2: Below75PercentOfMax
+        3: Below100PercentOfMax
+    - dimension: max_thermal_load
+      event_codes:
+        0: Under10
+        1: Under20
+        2: Under30
+        3: Under40
+        4: Under50
+        5: Under60
+        6: Under70
+        7: Under80
+        8: Under90
+        9: Under100
+    - dimension: max_cpu_p_state
+      event_codes:
+        0: PState0
+        1: PState1
+        2: PState2
+        3: PState3
+        4: PState4
+        5: PState5
+        6: PState6
+        7: PState7
+        8: PState8
+        9: PState9
+        10: PState10
+        11: PState11
+        12: PState12
+        13: PState13
+        14: PState14
+        15: PState15
+  reports:
+    - report_name: thermal_limiting_elapsed_time
+      id: 1
+      report_type: INT_RANGE_HISTOGRAM
+      system_profile_field: [BOARD_NAME, PRODUCT_NAME, ARCH, SYSTEM_VERSION, OS, CHANNEL]
+  meta_data:
+    max_release_stage: GA
+    expiration_date: "2021/02/13"
+
+
+#####################################################################
+# thermal_event_occurred
+#
+# Log an event where the device has crossed a thermal threshold. The
+# type of threshold that was crossed is indicated by the `event_type`
+# dimension. Crossing a thermal threshold indicates the device is
+# operating at a higher temperature than is desired or expected, and
+# should therefore be considered a generally rare event without an
+# estimate on frequency.
+#####################################################################
+- id: 2
+  metric_name: thermal_event_occurred
+  metric_type: EVENT_OCCURRED
+  metric_dimensions:
+    - dimension: event_type
+      event_codes:
+        0: ThermalLimitBegin
+        1: ThermalLimitEnd
+        2: ThermalShutdown
+      max_event_code: 7
+  reports:
+    - report_name: thermal_event_counts
+      id: 1
+      report_type: SIMPLE_OCCURRENCE_COUNT
+      system_profile_field: [BOARD_NAME, PRODUCT_NAME, ARCH, SYSTEM_VERSION, OS, CHANNEL]
+      local_privacy_noise_level: NONE
+  meta_data:
+    max_release_stage: GA
+    expiration_date: "2021/02/13"
+
+
+#####################################################################
+# selected_p_state
+#
+# Records the current CPU P-state selection at each iteration of the
+# thermal policy. The histogram data is flushed to Cobalt after 100
+# iterations (100 seconds).
+#####################################################################
+- id: 3
+  metric_name: selected_cpu_p_state
+  metric_type: INT_HISTOGRAM
+  int_buckets:
+    linear:
+      floor: 0
+      num_buckets: 16
+      step_size: 1
+  reports:
+    - report_name: selected_cpu_p_state_histogram
+      id: 1
+      report_type: INT_RANGE_HISTOGRAM
+      system_profile_field: [BOARD_NAME, PRODUCT_NAME, ARCH, SYSTEM_VERSION, OS, CHANNEL]
+  meta_data:
+    max_release_stage: GA
+    expiration_date: "2021/02/13"
+
+
+#####################################################################
+# raw_temperature
+#
+# Records the raw temperature as seen by the PowerManager at each
+# iteration of the thermal policy. The histogram data is flushed to
+# Cobalt after 100 iterations (100 seconds).
+#####################################################################
+- id: 4
+  metric_name: raw_temperature
+  metric_type: INT_HISTOGRAM
+  int_buckets:
+    linear:
+      floor: 20         # 20C
+      num_buckets: 80   # 20C - 100C
+      step_size: 1
+  reports:
+    - report_name: raw_temperature_histogram
+      id: 1
+      report_type: INT_RANGE_HISTOGRAM
+      system_profile_field: [BOARD_NAME, PRODUCT_NAME, ARCH, SYSTEM_VERSION, OS, CHANNEL]
+  meta_data:
+    max_release_stage: GA
+    expiration_date: "2021/02/13"
diff --git a/projects.yaml b/projects.yaml
index c462373..9c28dc0 100644
--- a/projects.yaml
+++ b/projects.yaml
@@ -20,7 +20,7 @@
 
 - customer_name:      fuchsia
   customer_id:        1
-  # Next project ID:  3
+  # Next project ID:  4
   projects:
 
 ################################################################################
@@ -81,3 +81,6 @@
     - project_name:    flash_ts
       project_id:      2
       project_contact: fuchsia-cobalt-dashboard-owners@google.com
+    - project_name:    power
+      project_id:      3
+      project_contact: fuchsia-cobalt-dashboard-owners@google.com