Skip to content

Commit

Permalink
script to parse results into R
Browse files Browse the repository at this point in the history
  • Loading branch information
jkanche committed Jan 30, 2022
1 parent 881570d commit 978b27f
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 123 deletions.
41 changes: 0 additions & 41 deletions cli-results/zilionis-lung/1.log

This file was deleted.

41 changes: 0 additions & 41 deletions cli-results/zilionis-lung/2.log

This file was deleted.

41 changes: 0 additions & 41 deletions cli-results/zilionis-lung/3.log

This file was deleted.

61 changes: 61 additions & 0 deletions process_metrics.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
library(jsonlite)

process_app_results <- function(dir) {
files <- list.files(dir, pattern="*.json")

results <- list()

for (f in files) {
fres <- list()
info = strsplit(f, "_")

fres[["dataset"]] <- info[[1]][1]
fres[["run"]] <- info[[1]][2]

metrics = jsonlite::fromJSON(file.path(dir, f))
fres[["time"]] <- metrics[["CustomTotalAnalysisTime"]]
fres[["jsTotalHeapSize"]] <- metrics[["JSHeapTotalSize"]]
fres[["JSHeapUsedSize"]] <- metrics[["JSHeapUsedSize"]]

results[[f]] <- fres
}

as.data.frame(do.call(rbind, lapply(results, as.vector)))
}


process_cli_results <- function(dir) {
dirs <- dir(dir)

results <- list()

for (d in dirs) {
runs <- list.files(file.path(dir, d))

for (r in runs) {

fres <- list()

fres[["dataset"]] <- d
fres[["run"]] <- r

metrics <- readLines(file.path(dir, d, r))

usertime <- metrics[19]
memory <- metrics[27]

fres[["time"]] <- strsplit(usertime, ":")[[1]][2]

fres[["maxResidentSetSize"]] <- strsplit(memory, ":")[[1]][2]

results[[file.path(dir, d, r)]] <- fres

}
}

as.data.frame(do.call(rbind, lapply(results, as.vector)))

}

df_app <- process_app_results("./app-results")
df_cli <- process_cli_results("./cli-results")

0 comments on commit 978b27f

Please sign in to comment.