Created
October 1, 2020 16:09
-
-
Save linuxkidd/be0d42ad195b082454a6e858e70224d9 to your computer and use it in GitHub Desktop.
Process sar disk await into a histogram
This file contains 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
#!/usr/bin/awk -f | |
/^[0-9].*dev[0-9]*-[0-9]*/{ | |
diskpos=2 | |
awaitpos=8 | |
if ( $2 ~ /(A|P)M/ ) { | |
diskpos=3 | |
awaitpos=9 | |
} | |
dev[$diskpos]=1 | |
histo[$diskpos][int($awaitpos)]++ | |
if(int($awaitpos)>max) | |
max=int($awaitpos) | |
} | |
END { | |
printf("Util%") | |
for(mydev in dev) { | |
printf(",%s",mydev) | |
} | |
printf("\n") | |
for(j=0;j<=max;j++) { | |
printf("%s",j) | |
for(mydev in dev) { | |
printf(",%s",histo[mydev][j]) | |
} | |
printf("\n") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
cat sar21 | ./proc_sar_disk_await_histo.awk > await_histo.csv
-- Generates output on stdout showing historgram data for await across all disks