Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: src/platform/power_manager/send_metrics_on_resume

Issue 2079014: Log time in suspend. (Closed) Base URL: ssh://git@chromiumos-git/chromeos
Patch Set: Simplify the option parsing code for now. Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/platform/init/dump-boot-stats.conf ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/bin/sh
2
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
6
7 # This script collects UMA metrics when the device is coming out of
8 # suspend or, if the machine shut down while in suspend, at boot time.
9 #
10 # Usage:
11 # -b -- indicates that this script is invoked at boot time.
12
13 F_SUSPEND_AT=/var/log/metrics/suspend-to-ram-time
14 [ -r $F_SUSPEND_AT ] || exit
15
16 RESUME_AT=`cat /sys/class/rtc/rtc0/since_epoch`
17 SUSPEND_AT=`cat $F_SUSPEND_AT`
18
19 rm -f $F_SUSPEND_AT
20
21 TIME_IN_SUSPEND_NAME=Power.TimeInSuspendAtResume
22 [ "$1" = "-b" ] && TIME_IN_SUSPEND_NAME=Power.TimeInSuspendAtBoot
23
24 if [ $RESUME_AT -gt $SUSPEND_AT ]; then
25 # Converts seconds to minutes rounding to the nearest whole minute.
26 TIME_IN_SUSPEND=$((($RESUME_AT - $SUSPEND_AT + 30) / 60))
27 /usr/bin/metrics_client $TIME_IN_SUSPEND_NAME $TIME_IN_SUSPEND 1 10000 50
28 fi
OLDNEW
« no previous file with comments | « src/platform/init/dump-boot-stats.conf ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698