Merge lp:~percona-toolkit-dev/percona-toolkit/fix-no-stalk-bug-955860 into lp:percona-toolkit/2.1

Proposed by Daniel Nichter
Status: Merged
Merged at revision: 223
Proposed branch: lp:~percona-toolkit-dev/percona-toolkit/fix-no-stalk-bug-955860
Merge into: lp:percona-toolkit/2.1
Diff against target: 113 lines (+35/-14)
4 files modified
bin/pt-stalk (+6/-6)
lib/bash/collect.sh (+6/-6)
t/lib/bash/collect.sh (+11/-1)
t/pt-stalk/pt-stalk.t (+12/-1)
To merge this branch: bzr merge lp:~percona-toolkit-dev/percona-toolkit/fix-no-stalk-bug-955860
Reviewer Review Type Date Requested Status
Daniel Nichter Approve
Review via email: mp+100240@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Daniel Nichter (daniel-nichter) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bin/pt-stalk'
--- bin/pt-stalk 2012-03-07 23:41:54 +0000
+++ bin/pt-stalk 2012-03-30 21:22:22 +0000
@@ -710,16 +710,16 @@
710 $CMD_SYSCTL -a >> "$d/$p-sysctl" &710 $CMD_SYSCTL -a >> "$d/$p-sysctl" &
711 fi711 fi
712 if [ "$CMD_VMSTAT" ]; then712 if [ "$CMD_VMSTAT" ]; then
713 $CMD_VMSTAT 1 $OPT_INTERVAL >> "$d/$p-vmstat" &713 $CMD_VMSTAT 1 $OPT_RUN_TIME >> "$d/$p-vmstat" &
714 $CMD_VMSTAT $OPT_INTERVAL 2 >> "$d/$p-vmstat-overall" &714 $CMD_VMSTAT $OPT_RUN_TIME 2 >> "$d/$p-vmstat-overall" &
715 fi715 fi
716 if [ "$CMD_IOSTAT" ]; then716 if [ "$CMD_IOSTAT" ]; then
717 $CMD_IOSTAT -dx 1 $OPT_INTERVAL >> "$d/$p-iostat" &717 $CMD_IOSTAT -dx 1 $OPT_RUN_TIME >> "$d/$p-iostat" &
718 $CMD_IOSTAT -dx $OPT_INTERVAL 2 >> "$d/$p-iostat-overall" &718 $CMD_IOSTAT -dx $OPT_RUN_TIME 2 >> "$d/$p-iostat-overall" &
719 fi719 fi
720 if [ "$CMD_MPSTAT" ]; then720 if [ "$CMD_MPSTAT" ]; then
721 $CMD_MPSTAT -P ALL 1 $OPT_INTERVAL >> "$d/$p-mpstat" &721 $CMD_MPSTAT -P ALL 1 $OPT_RUN_TIME >> "$d/$p-mpstat" &
722 $CMD_MPSTAT -P ALL $OPT_INTERVAL 1 >> "$d/$p-mpstat-overall" &722 $CMD_MPSTAT -P ALL $OPT_RUN_TIME 1 >> "$d/$p-mpstat-overall" &
723 fi723 fi
724724
725 $CMD_MYSQLADMIN $EXT_ARGV ext -i1 -c$OPT_RUN_TIME >>"$d/$p-mysqladmin" &725 $CMD_MYSQLADMIN $EXT_ARGV ext -i1 -c$OPT_RUN_TIME >>"$d/$p-mysqladmin" &
726726
=== modified file 'lib/bash/collect.sh'
--- lib/bash/collect.sh 2012-02-03 17:49:27 +0000
+++ lib/bash/collect.sh 2012-03-30 21:22:22 +0000
@@ -148,16 +148,16 @@
148 $CMD_SYSCTL -a >> "$d/$p-sysctl" &148 $CMD_SYSCTL -a >> "$d/$p-sysctl" &
149 fi149 fi
150 if [ "$CMD_VMSTAT" ]; then150 if [ "$CMD_VMSTAT" ]; then
151 $CMD_VMSTAT 1 $OPT_INTERVAL >> "$d/$p-vmstat" &151 $CMD_VMSTAT 1 $OPT_RUN_TIME >> "$d/$p-vmstat" &
152 $CMD_VMSTAT $OPT_INTERVAL 2 >> "$d/$p-vmstat-overall" &152 $CMD_VMSTAT $OPT_RUN_TIME 2 >> "$d/$p-vmstat-overall" &
153 fi153 fi
154 if [ "$CMD_IOSTAT" ]; then154 if [ "$CMD_IOSTAT" ]; then
155 $CMD_IOSTAT -dx 1 $OPT_INTERVAL >> "$d/$p-iostat" &155 $CMD_IOSTAT -dx 1 $OPT_RUN_TIME >> "$d/$p-iostat" &
156 $CMD_IOSTAT -dx $OPT_INTERVAL 2 >> "$d/$p-iostat-overall" &156 $CMD_IOSTAT -dx $OPT_RUN_TIME 2 >> "$d/$p-iostat-overall" &
157 fi157 fi
158 if [ "$CMD_MPSTAT" ]; then158 if [ "$CMD_MPSTAT" ]; then
159 $CMD_MPSTAT -P ALL 1 $OPT_INTERVAL >> "$d/$p-mpstat" &159 $CMD_MPSTAT -P ALL 1 $OPT_RUN_TIME >> "$d/$p-mpstat" &
160 $CMD_MPSTAT -P ALL $OPT_INTERVAL 1 >> "$d/$p-mpstat-overall" &160 $CMD_MPSTAT -P ALL $OPT_RUN_TIME 1 >> "$d/$p-mpstat-overall" &
161 fi161 fi
162162
163 # Collect multiple snapshots of the status variables. We use163 # Collect multiple snapshots of the status variables. We use
164164
=== modified file 't/lib/bash/collect.sh'
--- t/lib/bash/collect.sh 2012-02-24 16:39:49 +0000
+++ t/lib/bash/collect.sh 2012-03-30 21:22:22 +0000
@@ -1,6 +1,6 @@
1#!/usr/bin/env bash1#!/usr/bin/env bash
22
3plan 203plan 21
44
5TMPFILE="$TEST_TMPDIR/parse-opts-output"5TMPFILE="$TEST_TMPDIR/parse-opts-output"
6TMPDIR="$TEST_TMPDIR"6TMPDIR="$TEST_TMPDIR"
@@ -143,6 +143,16 @@
143iters=$(cat $p-df | grep -c '^TS ')143iters=$(cat $p-df | grep -c '^TS ')
144is "$iters" "2" "2 iteration/2s run time"144is "$iters" "2" "2 iteration/2s run time"
145145
146if [ -f "$p-vmstat" ]; then
147 n=$(awk '/[ ]*[0-9]/ { n += 1 } END { print n }' "$p-vmstat")
148 is \
149 "$n" \
150 "2" \
151 "vmstat runs for --run-time seconds (bug 955860)"
152else
153 is "1" "1" "SKIP vmstat not installed"
154fi
155
146# ############################################################################156# ############################################################################
147# Done157# Done
148# ############################################################################158# ############################################################################
149159
=== modified file 't/pt-stalk/pt-stalk.t'
--- t/pt-stalk/pt-stalk.t 2012-02-16 20:40:41 +0000
+++ t/pt-stalk/pt-stalk.t 2012-03-30 21:22:22 +0000
@@ -24,7 +24,7 @@
24 plan skip_all => 'Cannot connect to sandbox master';24 plan skip_all => 'Cannot connect to sandbox master';
25}25}
26else {26else {
27 plan tests => 25;27 plan tests => 26;
28}28}
2929
30my $cnf = "/tmp/12345/my.sandbox.cnf";30my $cnf = "/tmp/12345/my.sandbox.cnf";
@@ -263,6 +263,17 @@
263 "Not stalking, collect ran for --run-time"263 "Not stalking, collect ran for --run-time"
264);264);
265265
266my $vmstat = `which vmstat 2>/dev/null`;
267SKIP: {
268 skip "vmstat is not installed", 1 unless $vmstat;
269 chomp(my $n=`awk '/[ ]*[0-9]/ { n += 1 } END { print n }' "$dest/nostalk-vmstat"`);
270 is(
271 $n,
272 "2",
273 "vmstat ran for --run-time seconds (bug 955860)"
274 );
275};
276
266is(277is(
267 `cat $dest/nostalk-hostname`,278 `cat $dest/nostalk-hostname`,
268 `hostname`,279 `hostname`,

Subscribers

People subscribed via source and target branches