GATKRunReport now has an ID (random 32 char string) that uniquely identifies the JOB run and can be used to find a run in the run repository

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4171 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
depristo 2010-08-31 16:18:57 +00:00
parent 5e710050d6
commit b33873206a
2 changed files with 42 additions and 35 deletions

View File

@ -85,7 +85,10 @@ public class GATKRunReport {
// the listing of the fields is somewhat important; this is the order that the simple XML will output them // the listing of the fields is somewhat important; this is the order that the simple XML will output them
@ElementList(required = true, name = "gatk_header_Information") @ElementList(required = true, name = "gatk_header_Information")
private static List<String> mGATKHeader; private List<String> mGATKHeader;
@Element(required = false, name = "id")
private final String id;
@Element(required = false, name = "exception") @Element(required = false, name = "exception")
private final ExceptionToXML mException; private final ExceptionToXML mException;
@ -94,57 +97,56 @@ public class GATKRunReport {
private final GATKArgumentCollection mCollection; private final GATKArgumentCollection mCollection;
@Element(required = true, name = "working_directory") @Element(required = true, name = "working_directory")
private static String currentPath; private String currentPath;
@Element(required = true, name = "start_time") @Element(required = true, name = "start_time")
private static String startTime; private String startTime;
@Element(required = true, name = "end_time") @Element(required = true, name = "end_time")
private static String endTime; private String endTime;
@Element(required = true, name = "run_time") @Element(required = true, name = "run_time")
private static long runTime; private long runTime;
@Element(required = true, name = "command_line") @Element(required = true, name = "command_line")
private static String cmdLine; private String cmdLine;
@Element(required = true, name = "walker_name") @Element(required = true, name = "walker_name")
private static String walkerName; private String walkerName;
@Element(required = true, name = "svn_version") @Element(required = true, name = "svn_version")
private static String svnVersion; private String svnVersion;
@Element(required = true, name = "memory") @Element(required = true, name = "memory")
private static long memory; private long memory;
@Element(required = true, name = "java_tmp_directory") @Element(required = true, name = "java_tmp_directory")
private static String tmpDir; private String tmpDir;
@Element(required = true, name = "user_name") @Element(required = true, name = "user_name")
private static String userName; private String userName;
@Element(required = true, name = "host_name") @Element(required = true, name = "host_name")
private static String hostName; private String hostName;
@Element(required = true, name = "java") @Element(required = true, name = "java")
private static String java; private String java;
@Element(required = true, name = "machine") @Element(required = true, name = "machine")
private static String machine; private String machine;
@Element(required = true, name = "iterations") @Element(required = true, name = "iterations")
private static long nIterations; private long nIterations;
@Element(required = true, name = "reads") @Element(required = true, name = "reads")
private static long nReads; private long nReads;
@Element(required = true, name = "read_metrics") // @Element(required = true, name = "read_metrics")
private static String readMetrics; // private String readMetrics;
// TODO // TODO
// todo md5 all filenames // todo md5 all filenames
// todo size of filenames // todo size of filenames
// todo free memory on machine
public enum PhoneHomeOption { public enum PhoneHomeOption {
NO_ET, NO_ET,
@ -154,11 +156,6 @@ public class GATKRunReport {
private static final DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH.mm.ss"); private static final DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH.mm.ss");
static {
GATKRunReport.mGATKHeader = CommandLineGATK.createApplicationHeader();
currentPath = System.getProperty("user.dir");
}
/** /**
* Create a new RunReport and population all of the fields with values from the walker and engine * Create a new RunReport and population all of the fields with values from the walker and engine
* *
@ -167,7 +164,11 @@ public class GATKRunReport {
* @param engine the GAE we used to run the walker, so we can fetch runtime, args, etc * @param engine the GAE we used to run the walker, so we can fetch runtime, args, etc
*/ */
public GATKRunReport(Walker<?,?> walker, Exception e, GenomeAnalysisEngine engine) { public GATKRunReport(Walker<?,?> walker, Exception e, GenomeAnalysisEngine engine) {
mGATKHeader = CommandLineGATK.createApplicationHeader();
currentPath = System.getProperty("user.dir");
// what did we run? // what did we run?
id = org.apache.commons.lang.RandomStringUtils.randomAlphanumeric(32);
cmdLine = CommandLineUtils.createApproximateCommandLineArgumentString(engine, walker); cmdLine = CommandLineUtils.createApproximateCommandLineArgumentString(engine, walker);
this.mCollection = engine.getArguments(); this.mCollection = engine.getArguments();
walkerName = engine.getWalkerName(walker.getClass()); walkerName = engine.getWalkerName(walker.getClass());
@ -180,8 +181,8 @@ public class GATKRunReport {
runTime = (end.getTime() - engine.getStartTime().getTime()) / 1000L; // difference in seconds runTime = (end.getTime() - engine.getStartTime().getTime()) / 1000L; // difference in seconds
nIterations = engine.getCumulativeMetrics().getNumIterations(); nIterations = engine.getCumulativeMetrics().getNumIterations();
nReads = engine.getCumulativeMetrics().getNumReadsSeen(); nReads = engine.getCumulativeMetrics().getNumReadsSeen();
readMetrics = engine.getCumulativeMetrics().toString(); //readMetrics = engine.getCumulativeMetrics().toString();
memory = Runtime.getRuntime().totalMemory(); memory = Runtime.getRuntime().totalMemory(); // todo -- expand
tmpDir = System.getProperty("java.io.tmpdir"); tmpDir = System.getProperty("java.io.tmpdir");
// user and hostname -- information about the runner of the GATK // user and hostname -- information about the runner of the GATK
@ -196,6 +197,11 @@ public class GATKRunReport {
this.mException = e == null ? null : new ExceptionToXML(e); this.mException = e == null ? null : new ExceptionToXML(e);
} }
public String getID() {
return id;
}
/** /**
* Helper utility that calls into the InetAddress system to resolve the hostname. If this fails, * Helper utility that calls into the InetAddress system to resolve the hostname. If this fails,
* unresolvable gets returned instead. * unresolvable gets returned instead.
@ -254,7 +260,7 @@ public class GATKRunReport {
public void postReport() { public void postReport() {
try { try {
if ( repositoryIsOnline() ) { if ( repositoryIsOnline() ) {
String filename = org.apache.commons.lang.RandomStringUtils.randomAlphanumeric(32) + ".report.xml.gz"; String filename = getID() + ".report.xml.gz";
File file = new File(REPORT_SUBMIT_DIR, filename); File file = new File(REPORT_SUBMIT_DIR, filename);
postReport(file); postReport(file);
logger.info("Wrote report to " + file); logger.info("Wrote report to " + file);

View File

@ -45,6 +45,7 @@ import java.util.*;
public class WalkerTest extends BaseTest { public class WalkerTest extends BaseTest {
// the default output path for the integration test // the default output path for the integration test
private File outputFileLocation = null; private File outputFileLocation = null;
private static final boolean ENABLE_REPORTING = true;
/** /**
* Subdirectory under the ant build directory where we store integration test md5 results * Subdirectory under the ant build directory where we store integration test md5 results
@ -277,7 +278,7 @@ public class WalkerTest extends BaseTest {
cmd2[command.length] = "-l"; cmd2[command.length] = "-l";
cmd2[command.length+1] = "WARN"; cmd2[command.length+1] = "WARN";
cmd2[command.length+2] = "-et"; cmd2[command.length+2] = "-et";
cmd2[command.length+3] = "NO_ET"; cmd2[command.length+3] = ENABLE_REPORTING ? "STANDARD" : "NO_ET";
// run the executable // run the executable
CommandLineExecutable.start(instance, cmd2); CommandLineExecutable.start(instance, cmd2);