Browse code

remove sysstat & pidstat

dstat is far cleaner for getting results out of the environment,
and covers the bulk of our use cases for sysstat and pidstat with
a much better ui.

devstack is allowed to be opinionated, so become opinionated here.

Change-Id: I21ec96339dcd704098512fdafd896738f352962d

Sean Dague authored on 2014/02/26 00:23:04
Showing 5 changed files
1 1
deleted file mode 100644
... ...
@@ -1 +0,0 @@
1
-sysstat
2 1
deleted file mode 100644
... ...
@@ -1 +0,0 @@
1
-sysstat
2 1
deleted file mode 100644
... ...
@@ -1 +0,0 @@
1
-sysstat
... ...
@@ -294,15 +294,9 @@ SYSLOG=`trueorfalse False $SYSLOG`
294 294
 SYSLOG_HOST=${SYSLOG_HOST:-$HOST_IP}
295 295
 SYSLOG_PORT=${SYSLOG_PORT:-516}
296 296
 
297
-# Enable sysstat logging
298
-SYSSTAT_FILE=${SYSSTAT_FILE:-"sysstat.dat"}
299
-SYSSTAT_INTERVAL=${SYSSTAT_INTERVAL:-"1"}
300
-
297
+# for DSTAT logging
301 298
 DSTAT_FILE=${DSTAT_FILE:-"dstat.txt"}
302 299
 
303
-PIDSTAT_FILE=${PIDSTAT_FILE:-"pidstat.txt"}
304
-PIDSTAT_INTERVAL=${PIDSTAT_INTERVAL:-"5"}
305
-
306 300
 # Use color for logging output (only available if syslog is not used)
307 301
 LOG_COLOR=`trueorfalse True $LOG_COLOR`
308 302
 
... ...
@@ -862,23 +856,9 @@ fi
862 862
 # Initialize the directory for service status check
863 863
 init_service_check
864 864
 
865
-
866
-# Sysstat and friends
865
+# Dstat
867 866
 # -------
868 867
 
869
-# If enabled, systat has to start early to track OpenStack service startup.
870
-# what we want to measure
871
-# -u : cpu statitics
872
-# -q : load
873
-# -b : io load rates
874
-# -w : process creation and context switch rates
875
-SYSSTAT_OPTS="-u -q -b -w"
876
-if [[ -n ${SCREEN_LOGDIR} ]]; then
877
-    screen_it sysstat "cd $TOP_DIR; ./tools/sar_filter.py $SYSSTAT_OPTS -o $SCREEN_LOGDIR/$SYSSTAT_FILE $SYSSTAT_INTERVAL"
878
-else
879
-    screen_it sysstat "./tools/sar_filter.py $SYSSTAT_OPTS $SYSSTAT_INTERVAL"
880
-fi
881
-
882 868
 # A better kind of sysstat, with the top process per time slice
883 869
 DSTAT_OPTS="-tcndylp --top-cpu-adv"
884 870
 if [[ -n ${SCREEN_LOGDIR} ]]; then
... ...
@@ -887,15 +867,6 @@ else
887 887
     screen_it dstat "dstat $DSTAT_OPTS"
888 888
 fi
889 889
 
890
-# Per-process stats
891
-PIDSTAT_OPTS="-l -p ALL -T ALL"
892
-if [[ -n ${SCREEN_LOGDIR} ]]; then
893
-    screen_it pidstat "cd $TOP_DIR; pidstat $PIDSTAT_OPTS $PIDSTAT_INTERVAL > $SCREEN_LOGDIR/$PIDSTAT_FILE"
894
-else
895
-    screen_it pidstat "pidstat $PIDSTAT_OPTS $PIDSTAT_INTERVAL"
896
-fi
897
-
898
-
899 890
 # Start Services
900 891
 # ==============
901 892
 
902 893
deleted file mode 100755
... ...
@@ -1,86 +0,0 @@
1
-#!/usr/bin/env python
2
-#
3
-# Copyright 2014 Samsung Electronics Corp. All Rights Reserved.
4
-#
5
-# Licensed under the Apache License, Version 2.0 (the "License");
6
-# you may not use this file except in compliance with the License.
7
-# You may obtain a copy of the License at
8
-#
9
-#    http://www.apache.org/licenses/LICENSE-2.0
10
-#
11
-# Unless required by applicable law or agreed to in writing, software
12
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
-# License for the specific language governing permissions and limitations
15
-# under the License.
16
-
17
-import re
18
-import subprocess
19
-import sys
20
-
21
-
22
-def is_data_line(line):
23
-    timestamp, data = parse_line(line)
24
-    return re.search('\d\.d', data)
25
-
26
-
27
-def parse_line(line):
28
-    m = re.search('(\d\d:\d\d:\d\d( \w\w)?)(\s+((\S+)\s*)+)', line)
29
-    if m:
30
-        date = m.group(1)
31
-        data = m.group(3).rstrip()
32
-        return date, data
33
-    else:
34
-        return None, None
35
-
36
-
37
-process = subprocess.Popen(
38
-    "sar %s" % " ".join(sys.argv[1:]),
39
-    shell=True,
40
-    stdout=subprocess.PIPE,
41
-    stderr=subprocess.STDOUT)
42
-
43
-# Poll process for new output until finished
44
-
45
-start_time = ""
46
-header = ""
47
-data_line = ""
48
-printed_header = False
49
-current_ts = None
50
-
51
-# print out the first sysstat line regardless
52
-print process.stdout.readline()
53
-
54
-while True:
55
-    nextline = process.stdout.readline()
56
-    if nextline == '' and process.poll() is not None:
57
-        break
58
-
59
-    date, data = parse_line(nextline)
60
-    # stop until we get to the first set of real lines
61
-    if not date:
62
-        continue
63
-
64
-    # now we eat the header lines, and only print out the header
65
-    # if we've never seen them before
66
-    if not start_time:
67
-        start_time = date
68
-        header += "%s   %s" % (date, data)
69
-    elif date == start_time:
70
-        header += "   %s" % data
71
-    elif not printed_header:
72
-        printed_header = True
73
-        print header
74
-
75
-    # now we know this is a data line, printing out if the timestamp
76
-    # has changed, and stacking up otherwise.
77
-    nextline = process.stdout.readline()
78
-    date, data = parse_line(nextline)
79
-    if date != current_ts:
80
-        current_ts = date
81
-        print data_line
82
-        data_line = "%s   %s" % (date, data)
83
-    else:
84
-        data_line += "   %s" % data
85
-
86
-    sys.stdout.flush()