power_dashboard: Support weight average in CPUStatsLoggerDashboard

BUG=b:78032715
TEST=cpufreq data uploaded to power dashboard

Change-Id: I13e7e27268a3f854411b9128b49f4dbbb0ea3be3
Signed-off-by: Puthikorn Voravootivat <puthik@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1060516
Reviewed-by: Todd Broch <tbroch@chromium.org>
diff --git a/client/cros/power/power_dashboard.py b/client/cros/power/power_dashboard.py
index 89068a2..29fefd4 100644
--- a/client/cros/power/power_dashboard.py
+++ b/client/cros/power/power_dashboard.py
@@ -271,12 +271,16 @@
             uploadurl = 'http://chrome-power.appspot.com/rapl'
         super(CPUStatsLoggerDashboard, self).__init__(logger, testname,
                                                       resultsdir, uploadurl)
-        self._unit = 'percent'
 
     def _convert(self):
         power_dict = super(CPUStatsLoggerDashboard, self)._convert()
         for rail in power_dict['data']:
-            power_dict['type'][rail] = rail.rsplit('_', 1)[0]
+            if rail.startswith('wavg_'):
+                power_dict['type'][rail] = 'cpufreq_wavg'
+                power_dict['unit'][rail] = 'kilohertz'
+            else:
+                power_dict['type'][rail] = rail.rsplit('_', 1)[0]
+                power_dict['unit'][rail] = 'percent'
         return power_dict
 
     def _create_padded_domains(self):