Skip to content

Commit

Permalink
metrics: Fix percentage difference row
Browse files Browse the repository at this point in the history
Fix the percentage difference calculation for the metrics report generation.

Fixes kata-containers#709

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
  • Loading branch information
GabyCT committed Sep 26, 2018
1 parent d72794e commit 56262e2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions metrics/report/report_dockerfile/memory-footprint.R
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,13 @@ if (length(resultdirs) == 2) {
# This is a touch hard wired - but we *know* we only have two
# datasets...
diff=c("diff")
val = ((as.double(rstats[1,2]) / as.double(rstats[2,2])) * 100) - 100
diference = abs(as.double(rstats[1,2]) - as.double(rstats[2,2]))
average = (as.double(rstats[1,2]) + as.double(rstats[2,2])) / 2
val = 100 * (diference/average)
diff[2] = round(val, digits=2)
val = ((as.double(rstats[1,3]) / as.double(rstats[2,3])) * 100) - 100
diference = abs(as.double(rstats[1,3]) - as.double(rstats[2,3]))
average = (as.double(rstats[1,3]) + as.double(rstats[2,3])) / 2
val = 100 * (diference/average)
diff[3] = round(val, digits=2)
rstats=rbind(rstats, diff)

Expand Down

0 comments on commit 56262e2

Please sign in to comment.