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

Side by Side Diff: bootstat_get_last

Issue 5265008: Add new bootstat_get_last command (Closed) Base URL: http://git.chromium.org/git/bootstat.git@master
Patch Set: Rename bootstat_last to bootstat_get_last Created 10 years 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 | Annotate | Revision Log
« no previous file with comments | « README ('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 getfield() {
8 shift $1
9 echo $1
10 }
11
12 EVENT=$1
13 shift
14 if [ $# -eq 0 ]; then
15 set -- time
16 fi
17
18 while [ $# -gt 0 ]; do
19 case "$1" in
20 time)
21 TAG=uptime
22 FIELD=1
23 ;;
24 read-sectors)
25 TAG=disk
26 FIELD=3
27 ;;
28 write-sectors)
29 TAG=disk
30 FIELD=7
31 ;;
32 *)
33 shift
34 continue
35 ;;
36 esac
37 STATFILE=/tmp/${TAG}-${EVENT}
38 if [ -f $STATFILE ]; then
39 getfield $FIELD $(tail -1 $STATFILE)
40 fi
41 shift
42 done
OLDNEW
« no previous file with comments | « README ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698