Created
April 24, 2023 03:01
-
-
Save svrc/e3fcaf27619ae8436b01f2c54b630aa2 to your computer and use it in GitHub Desktop.
liveness
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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