summaryrefslogtreecommitdiff
path: root/util/temp_metrics.conf
diff options
context:
space:
mode:
Diffstat (limited to 'util/temp_metrics.conf')
-rw-r--r--util/temp_metrics.conf33
1 files changed, 33 insertions, 0 deletions
diff --git a/util/temp_metrics.conf b/util/temp_metrics.conf
new file mode 100644
index 0000000000..be8138aea3
--- /dev/null
+++ b/util/temp_metrics.conf
@@ -0,0 +1,33 @@
+# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+description "Temporary, quick-hack metrics collection daemon"
+author "chromium-os-dev@chromium.org"
+
+# This is for quickly adding UMA stats that we may need for
+# short-term experiments, when we don't have the time to add
+# stuff to metrics_daemon. That's where it should go in the
+# long term.
+start on started system-services
+stop on stopping system-services
+respawn
+
+script
+ TEMP_OFFSET=273 # difference between K (reported by EC) and C (used in UMA)
+ while true; do
+ sleep 30
+ ectool temps all | while read line; do
+ index=$(printf "%02d" "${line%%:*}")
+ tempk="${line##* }"
+ tempc=$(($tempk - $TEMP_OFFSET))
+ # ignore values below freezing
+ if [ $tempc -lt 0 ]; then
+ tempc=0
+ fi
+ # Use a linear histogram with 1 C buckets starting at 0.
+ N_SLOTS=180
+ metrics_client -e Platform.Temperature.Sensor$index $tempc $N_SLOTS
+ done
+ done
+end script