Browse code

Merge "remove sysstat & pidstat"

Jenkins authored on 2014/02/26 11:38:30
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
 
... ...
@@ -863,23 +857,9 @@ fi
863 863
 # Initialize the directory for service status check
864 864
 init_service_check
865 865
 
866
-
867
-# Sysstat and friends
866
+# Dstat
868 867
 # -------
869 868
 
870
-# If enabled, systat has to start early to track OpenStack service startup.
871
-# what we want to measure
872
-# -u : cpu statitics
873
-# -q : load
874
-# -b : io load rates
875
-# -w : process creation and context switch rates
876
-SYSSTAT_OPTS="-u -q -b -w"
877
-if [[ -n ${SCREEN_LOGDIR} ]]; then
878
-    screen_it sysstat "cd $TOP_DIR; ./tools/sar_filter.py $SYSSTAT_OPTS -o $SCREEN_LOGDIR/$SYSSTAT_FILE $SYSSTAT_INTERVAL"
879
-else
880
-    screen_it sysstat "./tools/sar_filter.py $SYSSTAT_OPTS $SYSSTAT_INTERVAL"
881
-fi
882
-
883 869
 # A better kind of sysstat, with the top process per time slice
884 870
 DSTAT_OPTS="-tcndylp --top-cpu-adv"
885 871
 if [[ -n ${SCREEN_LOGDIR} ]]; then
... ...
@@ -888,15 +868,6 @@ else
888 888
     screen_it dstat "dstat $DSTAT_OPTS"
889 889
 fi
890 890
 
891
-# Per-process stats
892
-PIDSTAT_OPTS="-l -p ALL -T ALL"
893
-if [[ -n ${SCREEN_LOGDIR} ]]; then
894
-    screen_it pidstat "cd $TOP_DIR; pidstat $PIDSTAT_OPTS $PIDSTAT_INTERVAL > $SCREEN_LOGDIR/$PIDSTAT_FILE"
895
-else
896
-    screen_it pidstat "pidstat $PIDSTAT_OPTS $PIDSTAT_INTERVAL"
897
-fi
898
-
899
-
900 891
 # Start Services
901 892
 # ==============
902 893
 
903 894
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()