-
Notifications
You must be signed in to change notification settings - Fork 196
metrics: Fix percentage difference row #775
Conversation
@grahamwhaley currently, I am fixing |
Hi @GabyCT . To show what I mean, I threw some obvious numbers into the .json files (100/80/110). From my original bad % code:
From your PR:
That's not quite what I had in mind though. I did a mod (for ref: using a formula like this, dropping the average and the if (length(resultdirs) == 2) {
# This is a touch hard wired - but we *know* we only have two
# datasets...
diff=c("diff")
diference = as.double(rstats[2,2]) - as.double(rstats[1,2])
# average = (as.double(rstats[1,2]) + as.double(rstats[2,2])) / 2
val = 100 * (diference/as.double(rstats[1,2]))
diff[2] = round(val, digits=2)
diference = as.double(rstats[2,3]) - as.double(rstats[1,3])
# average = (as.double(rstats[1,3]) + as.double(rstats[2,3])) / 2
val = 100 * (diference/as.double(rstats[1,3]))
diff[3] = round(val, digits=2)
rstats=rbind(rstats, diff)
unts[3]="%"
} which gets me:
which to my eyes makes a lot more sense. wdyt? Note: oh, also, whilst there - s/diference/difference/ ;-) |
@grahamwhaley , yes I saw that formula too, I got confused if we really wanted to see the + and - signs but for me that looks better, I will work on the changes and apply them in the rest of diffs that we have in the dockerfiles thanks |
56262e2
to
387cf6d
Compare
@grahamwhaley changes applied thanks |
Fix the percentage difference calculation for the metrics report generation. Fixes kata-containers#709 Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
@@ -98,7 +98,8 @@ if (length(resultdirs) == 2) { | |||
# This is a touch hard wired - but we *know* we only have two | |||
# datasets... | |||
for( i in 1:5) { | |||
val = ((as.double(rstats[1,i]) / as.double(rstats[2,i])) * 100) - 100 | |||
diference = as.double(rstats[2,i]) - as.double(rstats[1,i]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yay, this is looking good to me, and generated good output in my test. Just one tiny spelling niggle....
s/diference/difference/ throughout :-)
387cf6d
to
20cef91
Compare
@grahamwhaley changes applied |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
thanks for fixing my original wonky math ;-)
/test |
woow! good catch @GabyCT |
Fix the percentage difference calculation for the metrics report generation.
Fixes #709
Signed-off-by: Gabriela Cervantes gabriela.cervantes.tellez@intel.com