Skip to content

Instantly share code, notes, and snippets.

@AlexisDucastel
Created November 29, 2018 10:47
Show Gist options
  • Save AlexisDucastel/844c7bfa34c4c3849a4cf2511c6c9901 to your computer and use it in GitHub Desktop.
Save AlexisDucastel/844c7bfa34c4c3849a4cf2511c6c9901 to your computer and use it in GitHub Desktop.
Second scale metrics consumer
#!/bin/bash
COUNT=$1
tail -n$COUNT /home/ubuntu/metrics.log | \
awk '{M+=$1;U+=$2;N+=$3;S+=$4;I+=$5;T+=$6} END {printf "%d\t=%.2f+%.2f+%.2f+%.2f+%.2f\n",M/NR,U/NR,N/NR,S/NR,I/NR,T/NR}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment