From 393df460559b6681c97cd6cf5985b2477f427602 Mon Sep 17 00:00:00 2001 From: depristo Date: Tue, 1 Feb 2011 12:02:12 +0000 Subject: [PATCH] updates to handle only reporting on a specific SVN revision. Updated the R script to show the domain name of the runner, now that S3 logging is working git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@5157 348d0f76-0448-11de-a6fe-93d51630548a --- R/GATKRunReport.R | 8 ++++++-- python/analyzeRunReports.py | 17 ++++++++++++++++- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/R/GATKRunReport.R b/R/GATKRunReport.R index 10088d7e9..599abe25f 100644 --- a/R/GATKRunReport.R +++ b/R/GATKRunReport.R @@ -1,3 +1,4 @@ +require("plotrix") args = commandArgs(TRUE); onCMDLine = ! is.na(args[1]) @@ -10,6 +11,9 @@ if ( onCMDLine ) { d$end.time = as.Date(d$end.time) } # only read into d if its' available, otherwise assume the data is already loaded +# The unknown records are from the Broad +d$domain.name[d$domain.name == "unknown"] = "broadinstitute.org" + noRecords <- function(name) { print(paste("No records", name)) frame() @@ -127,7 +131,6 @@ generateOneReport <- function(d, header, includeByWeek = T) { reportConditionalCountingPlot(d$user.name, d$walker.name, head("Walker invocations by user")) reportCountingPlot(d$svn.version, head("SVN version")) reportConditionalCountingPlot(d$svn.version, d$user.name, head("SVN by user")) - # cuts by time if ( includeByWeek ) { @@ -170,6 +173,7 @@ generateOneReport <- function(d, header, includeByWeek = T) { reportHist(log10(d$run.time / min), head("Run time (log10[min])")) reportCountingPlot(d$user.name, head("user")) + reportCountingPlot(d$domain.name, head("Domain name")) #reportCountingPlot(d$host.name, head("host")) reportCountingPlot(d$java, head("Java version")) @@ -177,7 +181,7 @@ generateOneReport <- function(d, header, includeByWeek = T) { #reportCountingPlot(d$working.directory, head("Working directory")) } -RUNME = T +RUNME = F if ( RUNME ) { lastWeek = levels(cut(d$end.time, "weeks"))[-1] generateOneReport(d, "Overall") diff --git a/python/analyzeRunReports.py b/python/analyzeRunReports.py index 683f40f35..fff4659e0 100755 --- a/python/analyzeRunReports.py +++ b/python/analyzeRunReports.py @@ -32,6 +32,10 @@ def main(): action='store_true', default=False, help="if provided, only records not coming from a dev version of GATK will be included") + parser.add_option("", "--rev", dest="rev", + type="string", default=None, + help="if provided, only reports generated by this version of the GATK will be included") + parser.add_option("-E", "", dest="exception_selection", type='choice', choices=['all', 'user', 'sting'], default='all', help="if provided, will only emit records matching of the provided class [default %default]") @@ -142,6 +146,14 @@ class RecordDecoder: def formatExceptionUser(elt): return '%s' % parseException(elt)[2] + + def formatDomainName(elt): + if elt != None: + parts = elt.text.split(".") + if len(parts) >= 2: + return '.'.join(parts[-2:]) + else: + return 'unknown' def add(names, func): for name in names: @@ -153,7 +165,8 @@ class RecordDecoder: add(["id", "walker-name", "svn-version", "phone-home-type"], id) add(["start-time", "end-time"], toString) - add(["run-time", "java-tmp-directory", "working-directory", "user-name", "host-name"], id) + add(["run-time", "java-tmp-directory", "working-directory", "user-name"], id) + addComplex("host-name", ["host-name", "domain-name"], [id, formatDomainName]) add(["java", "machine"], toString) add(["max-memory", "total-memory", "iterations", "reads"], id) addComplex("exception", ["exception-msg", "exception-at", "exception-at-brief", "is-user-exception"], [formatExceptionMsg, formatExceptionAt, formatExceptionAtBrief, formatExceptionUser]) @@ -443,6 +456,8 @@ def passesFilters(elt): if OPTIONS.noDev and eltTagEquals(elt.find('argument-collection'),'phone-home-type','DEV'): #print 'skipping', elt return False + if OPTIONS.rev != None and not eltTagEquals(elt, 'svn-version', OPTIONS.rev): + return False if OPTIONS.maxDays != None: now = datetime.datetime.today() now = datetime.datetime(now.year, now.month, now.day)