Commit 468acf3b authored by Jeff Rasley's avatar Jeff Rasley
Browse files

Added timing info into workload gen

parent ecf5b016
......@@ -56,7 +56,9 @@ public class SparkTPCDSWorkloadGenerator {
System.out.println("Expected argument specifying dataset and query, eg impala-tpcds-modified-queries/q19.sql");
return;
}
long preLoad = System.currentTimeMillis();
// Load the benchmark
String[] splits = args[0].split(File.separator);
Benchmark b = QueryUtils.load().get(splits[0]);
......@@ -86,7 +88,9 @@ public class SparkTPCDSWorkloadGenerator {
TPCDSSettings settings = TPCDSSettings.createWithDefaults();
System.out.printf("Running query %s on %s dataset $s\n", q, settings.dataFormat, settings.dataLocation);
SparkTPCDSWorkloadGenerator gen = spinUp("SparkTPCDSWorkloadGenerator", settings);
long postLoad = System.currentTimeMillis();
// Run the query
Row[] rows = gen.sqlContext.sql(q.queryText).collect();
......@@ -94,6 +98,9 @@ public class SparkTPCDSWorkloadGenerator {
for (Row r : rows) {
System.out.println(r);
}
long postQ = System.currentTimeMillis();
System.out.println("Load time: " + (postLoad-preLoad) + ", Query time: " + (postQ-postLoad));
}
}
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