try this fix

This commit is contained in:
Stephen Smoogen 2017-02-15 19:57:02 +00:00
parent d4b9ad71b8
commit c9f72584af

View file

@ -4,18 +4,11 @@ BEGIN{
sum=0;
most=0;
least=0
print date ",AVG,LEAST,MAX"
}
{
newdate=strftime("%F",$1); # convert this to a printable date
if (date == strftime("%F",0)){ # we hit a min time and need to just print same stuff.
print date ",AVG,LEAST,MAX"
date=newdate;
count=1; # start count to 0. we should have 288 per day but logs are stupid
sum=$2; # start the sum
most=$2; # what is going to be our most per day
least=$2; # what is going to be our least per day
} else {
if (date != newdate){
print date "," int(sum/count) "," least "," most;
date=newdate;
@ -33,8 +26,8 @@ BEGIN{
least=$2;
}
}
}
}
END{
print date "," int(sum/count) "," least "," most;
}