summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuigi Semenzato <semenzato@chromium.org>2012-07-24 14:43:15 -0700
committerGerrit <chrome-bot@google.com>2012-07-25 09:49:02 -0700
commit0e82420f1203547e5ac3365933f00acc31c49daf (patch)
treece0c493e0f3139dae1c9df782c47696016aab47e
parent89f6448982349c3f9b7f9fed61a9fe133d4c3aa4 (diff)
downloadchrome-ec-0e82420f1203547e5ac3365933f00acc31c49daf.tar.gz
Add upstart script to collect temperature statistics.
This is used only in selected platforms, and installed by the temp-metrics package in the private overlay for those platforms. BUG=chrome-os-partner:11631 TEST=manually using about:histograms Signed-off-by: Luigi Semenzato <semenzato@chromium.org> Change-Id: I89dffed6aa34d683ff78a360988fdfb84c2dc641 Reviewed-on: https://gerrit.chromium.org/gerrit/28311 Tested-by: Luigi Semenzato <semenzato@chromium.org> Reviewed-by: Richard Barnette <jrbarnette@chromium.org> Commit-Ready: Luigi Semenzato <semenzato@chromium.org>
-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