diff --git a/benchmark/plots.r b/benchmark/plots.r index 1b9d59f916ecacd5ddce3dd8f485ecb4e30d351a..443ef9d158b354f037ba1e39ea10d576a74b090f 100644 --- a/benchmark/plots.r +++ b/benchmark/plots.r @@ -13,45 +13,46 @@ convert_time <- function(x){ sec <- 0 minute <- 0 hours <- 0 + mili <- 0 for ( single in part ) { - if (grepl('s', single, fixed = TRUE)) { + if (grepl('\\d+s', single)) { sec <- as.numeric(substr(single,1,nchar(single)-1)) sec <- sec/60 sec <- as.numeric(format(round(sec, 3), nsmall = 3)) - #print(sec) } - if (grepl('m', single, fixed = TRUE)) { + if (grepl('\\d+m$', single)) { minute <- as.numeric(substr(single,1,nchar(single)-1)) minute <- as.numeric(format(round(minute, 2), nsmall = 2)) - #print(minute) } - if (grepl('h', single, fixed = TRUE)) { + if (grepl('\\d+h', single)) { hours <- as.numeric(substr(single,1,nchar(single)-1)) hours <- hours*60 hours <- as.numeric(format(round(hours, 2), nsmall = 2)) - #print(hours) - #print(single) } - #print(sec) - #print(minute) - #print(hours) + + if (grepl('\\d+ms', single)) { + mili <- as.numeric(substr(single,1,nchar(single)-2)) + if (mili > 0) { + mili <- (mili/1000)/60 + mili <- as.numeric(format(round(mili, 4), nsmall = 4)) + } + } } - new_duration <- (hours+minute+sec) + new_duration <- (hours+minute+sec+mili) list_durations <- append(list_durations,new_duration) - #print(new_duration) - #print(df$duration[i]) - #df$duration[i] <- new_duration } - #print(list_durations) return(list_durations) } list_dur <- convert_time(df$duration) -df$duration +list_realtime <- convert_time(df$realtime) df$duration_minutes <- list_dur df$duration_minutes <- as.numeric(df$duration_minutes) +df$realtime_minutes <- list_realtime +df$realtime_minutes <- as.numeric(df$realtime_minutes) + val <- df %>% group_by(name) %>% summarise(moy = mean(duration_minutes), ect = sd(duration_minutes)) workflow <- character(0) @@ -76,24 +77,23 @@ for (x in df$file) { } df$file <- filenames +important_processes <- c(15, 16, 17, 18, 7, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,9,1,2,5,6,1,1,1,1,1,15,11,1,1,1,1,12,1,1,1,1,1) + +ggplot(df, aes(x = name, y = duration_minutes)) + + geom_point(aes(color = name, shape = name)) + + scale_shape_manual(values = important_processes) + + facet_wrap(~ file, ncol = 8) + + scale_y_continuous(breaks = seq(0, 490, by = 30)) + + xlab("Processes") + + ylab("Duration in minutes") + + theme(axis.text.x=element_blank(), axis.ticks.x=element_blank()) + +ggplot(df, aes(x = name, y = realtime_minutes)) + + geom_point(aes(color = name, shape = name)) + + scale_shape_manual(values = important_processes) + + facet_wrap(~ file, ncol = 8) + + scale_y_continuous(breaks = seq(0, 490, by = 30)) + + xlab("Processes") + + ylab("Duration in minutes") + + theme(axis.text.x=element_blank(), axis.ticks.x=element_blank()) - - -# ggplot(df, aes(x=name, y=duration_minutes))+ -# geom_violin()+ -# ylim(0,500)+ -# facet_wrap(~ name, ncol = 8) - -important_processes <- c(15, 16, 17, 18, 7, 1, 1, 1, 1, 1, 1, 1, 1,1,1,1,1,9,1,2,5,6,1,1,1,1,1,1,11,1,1,1,1,12,1,1,1,1,1) - -ggplot(df, aes(x = name, y = duration_minutes))+ - geom_point(aes(color = name, shape = name))+ - scale_shape_manual(values = important_processes)+ - facet_wrap(~ file, ncol = 8) - -# for (x in df$duration_minutes) { -# print(class(x)) -# } - -# mean(df$duration_minutes) -# sd(df$duration_minutes)