Skip to content

Commit b9e6a58

Browse files
committed
Record total runtime of ghe-backup and ghe-restore
This adds the total runtime of ghe-backup and ghe-restore to the benchmark output. When investigating benchmark performance issues with customers and inspecting the benchmark output, it is helpful to know the total runtime of ghe-backup and ghe-restore as a reference for checking the durations of individual execution steps. While the stdout output currently shows the total runtime, customers generally do not store this output on disk, which makes it difficult to investigate backup-related performance issues after the fact. The runtime is recorded regardless of whether or not the commands completed successfully, as it may still be useful to see how long they have run when terminated early because of an error or human intervention.
1 parent 36cb4db commit b9e6a58

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

bin/ghe-backup

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ cleanup () {
121121

122122
# Cleanup SSH multiplexing
123123
ghe-ssh --clean
124+
125+
bm_end "$(basename $0)"
124126
}
125127

126128
# Setup exit traps
@@ -216,6 +218,7 @@ fi
216218
echo "$GHE_SNAPSHOT_TIMESTAMP $$" > ../in-progress
217219
echo "$GHE_SNAPSHOT_TIMESTAMP $$" > "${GHE_DATA_DIR}/in-progress-backup"
218220

221+
bm_start "$(basename $0)"
219222
START_TIME=$(date +%s)
220223
log_info "Starting backup of $GHE_HOSTNAME with backup-utils v$BACKUP_UTILS_VERSION in snapshot $GHE_SNAPSHOT_TIMESTAMP"
221224

bin/ghe-restore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ cleanup () {
138138
if ! rm -f "${GHE_DATA_DIR}/in-progress-restore"; then
139139
log_error "Failed to remove in-progress file" 1>&3
140140
fi
141+
142+
bm_end "$(basename $0)"
141143
}
142144

143145
# This function's type definition is being passed to a remote host via `ghe-ssh` but is not used locally.
@@ -322,6 +324,7 @@ export PROGRESS=0 # Used to track progress of restore
322324
echo "$PROGRESS" > /tmp/backup-utils-progress
323325

324326
# Log restore start message locally and in /var/log/syslog on remote instance
327+
bm_start "$(basename $0)"
325328
START_TIME=$(date +%s)
326329
log_info "Starting restore of $GHE_HOSTNAME with backup-utils v$BACKUP_UTILS_VERSION from snapshot $GHE_RESTORE_SNAPSHOT"
327330

0 commit comments

Comments
 (0)