mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-02 18:45:57 +00:00
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:
@@ -887,7 +887,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")"
|
||||
|
||||
disk_space $d > $d/$p-disk-space
|
||||
check_disk_space \
|
||||
@@ -896,6 +895,9 @@ collect() {
|
||||
"$OPT_DISK_PCT_FREE" \
|
||||
|| break
|
||||
|
||||
sleep $(date +'%s.%N' | awk "{print $OPT_SLEEP_COLLECT - (\$1 % $OPT_SLEEP_COLLECT)}")
|
||||
local ts="$(date +"TS %s.%N %F %T")"
|
||||
|
||||
if [ -d "/proc" ]; then
|
||||
if [ -f "/proc/diskstats" ]; then
|
||||
(echo $ts; cat /proc/diskstats) >> "$d/$p-diskstats" &
|
||||
@@ -926,7 +928,6 @@ collect() {
|
||||
(echo $ts; transactions) >>"$d/$p-transactions" &
|
||||
fi
|
||||
|
||||
sleep $OPT_SLEEP_COLLECT
|
||||
curr_time=$(date +'%s')
|
||||
done
|
||||
log "Loop end: $(date +'TS %s.%N %F %T')"
|
||||
@@ -1996,7 +1997,9 @@ reasonably.
|
||||
|
||||
type: int; default: 1
|
||||
|
||||
How long to sleep between collection loop cycles.
|
||||
How long to sleep between collection loop cycles. This is useful with
|
||||
C<--no-stalk> to do long collections. For example, to collect data every
|
||||
minute for an hour, specify: C<--no-stalk --run-time 3600 --sleep-collect 60>.
|
||||
|
||||
=item --socket
|
||||
|
||||
|
@@ -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')"
|
||||
|
@@ -4,5 +4,5 @@
|
||||
--
|
||||
-umsandbox
|
||||
-pmsandbox
|
||||
--host 127.1
|
||||
--host 127.0.0.1
|
||||
--port 12345
|
||||
|
Reference in New Issue
Block a user