Commit fe8a0bc5 authored by Holger Brandl's avatar Holger Brandl
Browse files

remove md_report dependencies

parent 870af59a
......@@ -4,9 +4,7 @@
devtools::source_url("https://dl.dropboxusercontent.com/u/113630701/datautils/R/core_commons.R")
devtools::source_url("https://dl.dropboxusercontent.com/u/113630701/datautils/R/ggplot_commons.R")
devtools::source_url("https://raw.githubusercontent.com/holgerbrandl/mdreport/master/R/mdreport-package.r")
require.auto(lubridate)
......@@ -26,9 +24,7 @@ if(!exists("reportName")){
}
reportNiceName <- str_replace_all(reportName, "^[.]", "")
md_new(paste("Job Report:", reportNiceName))
#require.auto(data.table)
#' # Job Report: `reportNiceName`
echo("processing job report for '", reportName,"'")
......@@ -87,7 +83,7 @@ save(jobData, file=concat(reportName, ".cluster_snapshots.RData"))
#jobData <- local(get(load(concat(reportName, ".cluster_snapshots.RData"))))
#ggplot(jobData, aes(exec_time_min, cpu_used_secs, group=jobid)) + geom_line(alpha=0.3) + geom_smooth() + ggtitle("accumulated cpu usage")
md_plot(ggplot(jobData, aes(exec_time_hours, cpu_used_hours, group=jobid)) + geom_line(alpha=0.3) + ggtitle("accumulated cpu usage") + geom_vline(aes(xintercept=queueLimit), color="red"))
ggplot(jobData, aes(exec_time_hours, cpu_used_hours, group=jobid)) + geom_line(alpha=0.3) + ggtitle("accumulated cpu usage") + geom_vline(aes(xintercept=queueLimit), color="red")
#### ussage per time interval
jobDataSlim <- with(jobData, data.frame(jobid, num_cores, cpu_used_secs, exec_time=as.numeric(exec_time)))
......@@ -96,7 +92,10 @@ smoothData <- ddply(jobDataCPUChange, .(jobid), mutate, exec_period=c(NA, diff(a
smoothData[is.na(smoothData)] <- 0
#ggplot(smoothData, aes(exec_time, cpu_usage_in_period, color=jobid)) + geom_line()
md_plot(ggplot(subset(smoothData, cpu_usage_in_period>0), aes(exec_time/3600, cpu_usage_in_period/(exec_period* as.numeric(as.character(num_cores))), color=num_cores, group=jobid)) + geom_line(alpha=0.3) + xlab("exec time [hours]") + ylab("core normalized cpu usage")) # + scale_color_discrete(name="jobid")
ggplot(subset(smoothData, cpu_usage_in_period>0), aes(exec_time/3600, cpu_usage_in_period/(exec_period* as.numeric(as.character(num_cores))), color=num_cores, group=jobid)) +
geom_line(alpha=0.3) +
xlab("exec time [hours]") +
ylab("core normalized cpu usage") # + scale_color_discrete(name="jobid")
......@@ -108,27 +107,26 @@ jobSummaries <- transform(jobSummaries, jobid=reorder(jobid, as.numeric(jobid)))
#ggplot(jobSummaries, aes(pending_time_min)) + geom_histogram() + ggtitle("pending times") + coord_flip()
if(nrow(jobSummaries)<50){
md_plot(ggplot(jobSummaries, aes(reorder(jobid, -as.numeric(jobid)), pending_time_min/60)) + geom_bar(stat="identity") + ggtitle("pending times") + coord_flip() + xlab("job id"))
ggplot(jobSummaries, aes(reorder(jobid, -as.numeric(jobid)), pending_time_min/60)) + geom_bar(stat="identity") + ggtitle("pending times") + coord_flip() + xlab("job id")
}else{
md_plot(ggplot(jobSummaries, aes(as.numeric(jobid), pending_time_min/60)) + geom_area() + ggtitle("pending times")+xlab("job_nr") + ylab("pending time [h]"))
ggplot(jobSummaries, aes(as.numeric(jobid), pending_time_min/60)) + geom_area() + ggtitle("pending times")+xlab("job_nr") + ylab("pending time [h]")
}
#ggsave2(p=reportName)
if(nrow(jobSummaries)<50){
md_plot(ggplot(jobSummaries, aes(reorder(jobid, -as.numeric(jobid)), exec_time_hours)) + geom_bar(stat="identity") + ggtitle("job execution times") + coord_flip() + xlab("job id"))
ggplot(jobSummaries, aes(reorder(jobid, -as.numeric(jobid)), exec_time_hours)) + geom_bar(stat="identity") + ggtitle("job execution times") + coord_flip() + xlab("job id")
}else{
md_plot(ggplot(jobSummaries, aes(as.numeric(jobid), exec_time_hours)) + geom_area() + ggtitle("job execution times")+ xlab("job_nr") + geom_hline(mapping=aes(yintercept=queueLimit), color="red"))
ggplot(jobSummaries, aes(as.numeric(jobid), exec_time_hours)) + geom_area() + ggtitle("job execution times")+ xlab("job_nr") + geom_hline(mapping=aes(yintercept=queueLimit), color="red")
}
#ggplot(jobSummaries, aes(as.numeric(jobidx), exec_time_min/pending_time_min)) + geom_area() + ggtitle("pending vs exec time ratio")+xlab("job_nr")
md_plot(ggplot(jobSummaries, aes(exec_time_min, pending_time_min)) + geom_point() + ggtitle("pending vs exec time") + geom_abline())
ggplot(jobSummaries, aes(exec_time_min, pending_time_min)) + geom_point() + ggtitle("pending vs exec time") + geom_abline()
write.delim(jobSummaries, file=concat(reportName, ".jobSummaries.txt"))
# jobSummaries <- read.delim("jobSummaries.txt")
jobSummaries %>% mutate(pending_time_hours=pending_time_min/60) %>% select(jobid, exec_host, job_name, cpu_used_hours, pending_time_hours, exec_time_hours) %>% md_table("Job Summaries")
md_report(paste0(reportNiceName, "_batch_report"), open=F)
require(knitr)
jobSummaries %>% mutate(pending_time_hours=pending_time_min/60) %>% select(jobid, exec_host, job_name, cpu_used_hours, pending_time_hours, exec_time_hours) %>% kable()
#######################################################################################################################
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment