From 0e82420f1203547e5ac3365933f00acc31c49daf Mon Sep 17 00:00:00 2001 From: Luigi Semenzato Date: Tue, 24 Jul 2012 14:43:15 -0700 Subject: 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 Change-Id: I89dffed6aa34d683ff78a360988fdfb84c2dc641 Reviewed-on: https://gerrit.chromium.org/gerrit/28311 Tested-by: Luigi Semenzato Reviewed-by: Richard Barnette Commit-Ready: Luigi Semenzato --- util/temp_metrics.conf | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 util/temp_metrics.conf 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 -- cgit v1.2.1