summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Seurer <konstantin.seurer@gmail.com>2023-12-17 15:23:54 +0100
committerRhys Perry <pendingchaos02@gmail.com>2024-02-26 17:27:16 +0000
commita0411a1a0da019d939ac2e8796aa72beed49cfce (patch)
tree796b7f09815d65928b6fbe372a0341d6246711c7
parent694f77c5c1aa5b3bb08443b5038f55feb17ec7ab (diff)
fossils: Print replay durationHEADmaster
This patch prints the replay duration after the "Replaying $db" output. It should be useful for spotting slow fossils. Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com> Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
-rwxr-xr-xfossil_replay.sh12
1 files changed, 10 insertions, 2 deletions
diff --git a/fossil_replay.sh b/fossil_replay.sh
index 4731254..282de81 100755
--- a/fossil_replay.sh
+++ b/fossil_replay.sh
@@ -32,17 +32,25 @@ for db in `find -L "$1" -type f -name "*.foz"`; do
fi
# Append stdout/stderr to file to reduce spam
- echo "Replaying $db"
+ echo -n "Replaying $db"
echo "Replaying $db" >> "/tmp/fossil_replay.txt"
rm -f "$2".tmp
+
+ start_time_ns=$(date +%s%N)
fossilize-replay --enable-pipeline-stats "$2".tmp ${@:3} "$db" 1>&2 2>> "/tmp/fossil_replay.txt"
+ end_time_ns=$(date +%s%N)
# Check for failures
if [ ! -e "$2".tmp ]; then
rm -f "$2".tmp.__tmp.foz
- echo "Replay of $db failed"
+ echo " failed"
grep "pipeline crashed or hung" /tmp/fossil_replay.txt
exit 1
+ else
+ duration_ns=$(($end_time_ns-$start_time_ns))
+ duration_s=$(($duration_ns/1000000000))
+ duration_cs=$(($(($duration_ns/10000000))-$(($duration_s*100))))
+ echo " took $duration_s.$(($duration_cs))s"
fi
# Append to result CSV