OLD | NEW |
1 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 # dump-boot-stats | 5 # dump-boot-stats |
6 # | 6 # |
7 # when login-prompt-ready is received, grabs the current uptime and | 7 # when login-prompt-ready is received, grabs the current uptime and |
8 # disk stats. Also sends uptime to metrics client for perf dashboard | 8 # disk stats. Also sends uptime to metrics client for perf dashboard |
9 | 9 |
10 start on login-prompt-ready | 10 start on login-prompt-ready |
11 | 11 |
12 # This is run-once rather than a service. | 12 # This is run-once rather than a service. |
13 task | 13 task |
14 | 14 |
15 script | 15 script |
16 UPTIME_STATS=`cat /proc/uptime` | 16 UPTIME_STATS=`cat /proc/uptime` |
17 DISK_STATS=`cat /sys/block/sda/stat` | 17 DISK_STATS=`cat /sys/block/sda/stat` |
18 | 18 |
19 BOOT_TIME=`echo $UPTIME_STATS | cut -f 1 -d ' '` | 19 BOOT_TIME=`echo $UPTIME_STATS | cut -f 1 -d ' '` |
20 SECTORS_READ=`echo $DISK_STATS | cut -f 3 -d ' '` | 20 SECTORS_READ=`echo $DISK_STATS | cut -f 3 -d ' '` |
21 SECTORS_WRITTEN=`echo $DISK_STATS | cut -f 7 -d ' '` | 21 SECTORS_WRITTEN=`echo $DISK_STATS | cut -f 7 -d ' '` |
22 | 22 |
23 /usr/bin/metrics_client -t BootTime $BOOT_TIME & | 23 /usr/bin/metrics_client -t \ |
24 /usr/bin/metrics_client BootSectorsRead $SECTORS_READ & | 24 Platform.BootTime $BOOT_TIME 1 30000 50 & |
25 /usr/bin/metrics_client BootSectorsWritten $SECTORS_WRITTEN & | 25 /usr/bin/metrics_client \ |
| 26 Platform.BootSectorsRead $SECTORS_READ 1 1000000 50 & |
| 27 /usr/bin/metrics_client \ |
| 28 Platform.BootSectorsWritten $SECTORS_WRITTEN 1 10000 50 & |
26 | 29 |
27 echo $UPTIME_STATS > /tmp/uptime-login-prompt-ready | 30 echo $UPTIME_STATS > /tmp/uptime-login-prompt-ready |
28 echo $DISK_STATS > /tmp/disk-login-prompt-ready | 31 echo $DISK_STATS > /tmp/disk-login-prompt-ready |
29 end script | 32 end script |
OLD | NEW |