Revert r587: *do* sync on clock ticks. Fix pt-stalk.t (127.1 no longer works?). Enhance --sleep-collect docs.

This commit is contained in:
Daniel Nichter
2013-12-13 20:19:51 -08:00
parent 5035de3fbb
commit 69586fdf50
3 changed files with 12 additions and 7 deletions

View File

@@ -182,7 +182,6 @@ collect() {
local start_time=$(date +'%s')
local curr_time=$start_time
while [ $((curr_time - start_time)) -lt $OPT_RUN_TIME ]; do
local ts="$(date +"TS %s.%N %F %T")"
# We check the disk, but don't exit, because we need to stop jobs if we
# need to exit.
@@ -193,6 +192,11 @@ collect() {
"$OPT_DISK_PCT_FREE" \
|| break
# Sleep between collect cycles.
# Synchronize ourselves onto the clock tick, so the sleeps are 1-second
sleep $(date +'%s.%N' | awk "{print $OPT_SLEEP_COLLECT - (\$1 % $OPT_SLEEP_COLLECT)}")
local ts="$(date +"TS %s.%N %F %T")"
# #####################################################################
# Collect data for this cycle.
# #####################################################################
@@ -226,8 +230,6 @@ collect() {
(echo $ts; transactions) >>"$d/$p-transactions" &
fi
# Sleep between collect cycles.
sleep $OPT_SLEEP_COLLECT
curr_time=$(date +'%s')
done
log "Loop end: $(date +'TS %s.%N %F %T')"