try this fix
This commit is contained in:
parent
d4b9ad71b8
commit
c9f72584af
1 changed files with 11 additions and 18 deletions
|
@ -4,18 +4,11 @@ BEGIN{
|
||||||
sum=0;
|
sum=0;
|
||||||
most=0;
|
most=0;
|
||||||
least=0
|
least=0
|
||||||
|
print date ",AVG,LEAST,MAX"
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
newdate=strftime("%F",$1); # convert this to a printable date
|
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){
|
if (date != newdate){
|
||||||
print date "," int(sum/count) "," least "," most;
|
print date "," int(sum/count) "," least "," most;
|
||||||
date=newdate;
|
date=newdate;
|
||||||
|
@ -33,8 +26,8 @@ BEGIN{
|
||||||
least=$2;
|
least=$2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
END{
|
END{
|
||||||
print date "," int(sum/count) "," least "," most;
|
print date "," int(sum/count) "," least "," most;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue