Merge lp:~percona-toolkit-dev/percona-toolkit/fix-1046440-pt-stalk-purge_samples into lp:percona-toolkit/2.1

Proposed by Brian Fraser
Status: Merged
Approved by: Brian Fraser
Approved revision: 479
Merged at revision: 500
Proposed branch: lp:~percona-toolkit-dev/percona-toolkit/fix-1046440-pt-stalk-purge_samples
Merge into: lp:percona-toolkit/2.1
Diff against target: 34 lines (+10/-5)
1 file modified
bin/pt-stalk (+10/-5)
To merge this branch: bzr merge lp:~percona-toolkit-dev/percona-toolkit/fix-1046440-pt-stalk-purge_samples
Reviewer Review Type Date Requested Status
Brian Fraser (community) Approve
Daniel Nichter Approve
Review via email: mp+138250@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Daniel Nichter (daniel-nichter) :
review: Approve
Revision history for this message
Brian Fraser (fraserbn) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/pt-stalk'
2--- bin/pt-stalk 2012-11-19 18:47:13 +0000
3+++ bin/pt-stalk 2012-12-05 16:47:22 +0000
4@@ -1189,6 +1189,11 @@
5 # There will not be enough disk space, so do not collect.
6 warn "Collect canceled because there will not be enough disk space after collecting another $margin MB"
7 fi
8+
9+ # Purge old collect files.
10+ if [ -d "$OPT_DEST" ]; then
11+ purge_samples "$OPT_DEST" "$OPT_RETENTION_TIME"
12+ fi
13 fi
14
15 # ##################################################################
16@@ -1204,13 +1209,13 @@
17 # Trigger/check/value is ok, sleep until next check.
18 sleep_ok "$OPT_INTERVAL"
19 fi
20-
21- # Purge old collect file between checks.
22- if [ -d "$OPT_DEST" ]; then
23- purge_samples "$OPT_DEST" "$OPT_RETENTION_TIME"
24- fi
25 done
26
27+ # One final purge of old collect files, but only if in collect mode.
28+ if [ "$OPT_COLLECT" -a -d "$OPT_DEST" ]; then
29+ purge_samples "$OPT_DEST" "$OPT_RETENTION_TIME"
30+ fi
31+
32 # Before exiting, the last collector may still be running.
33 # Wait for it to finish in case the tool is part of a script,
34 # or part of a test, so the caller has access to the collected

Subscribers

People subscribed via source and target branches