Skip to content

Instantly share code, notes, and snippets.

@svrc
Created April 24, 2023 03:01
Show Gist options
  • Save svrc/e3fcaf27619ae8436b01f2c54b630aa2 to your computer and use it in GitHub Desktop.
Save svrc/e3fcaf27619ae8436b01f2c54b630aa2 to your computer and use it in GitHub Desktop.
liveness
while read newline
do
new=$(date -d "$(echo "$newline" | sed -E 's/-([0-9][0-9])\.([0-9][0-9])\./ \1:\2:/')" '+%s')
if [ "$old" ] && (( $new - $old > 20))
then
printf "%4i seconds gap before %s" "$((new - old))" "$newline"
fi
old=$new
done <check_liveness.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment