summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew McDermott <andrew.mcdermott@linaro.org>2014-05-19 09:55:11 +0100
committerAndrew McDermott <andrew.mcdermott@linaro.org>2014-05-19 09:55:11 +0100
commit21fa13e1ba2b9e99307627dc815102a97bdc563c (patch)
treefdbb2d8bc0fdce9054e72ff9de2852e3903c6fba
parent3ac363e2e2fe182dbcae13bb88822fad1e22cbb2 (diff)
Use YY-MM-DD as timestamp value when storing results
YY-MM-DD is converted to an epoch value. When inserted into the DB duplicate values are replaced. Signed-off-by: Andrew McDermott <andrew.mcdermott@linaro.org>
-rwxr-xr-xbenchmark-terasort3
-rwxr-xr-xupdate-results-db2
2 files changed, 3 insertions, 2 deletions
diff --git a/benchmark-terasort b/benchmark-terasort
index 6aa69f4..1eb6b74 100755
--- a/benchmark-terasort
+++ b/benchmark-terasort
@@ -64,7 +64,8 @@ function benchmark_terasort() {
hadoop fs -rm -R ${NGIGABYTES}GB-sorted
sed -i 's/\..*//' $elapsed_time_file
elapsed_time=$(cat $elapsed_time_file)
- echo "$(date +'%s'),$jvm_type,$NGIGABYTES,$elapsed_time" >> $BENCHMARK_RESULTS_DIR/results.csv
+ local date_as_epoch=$(date --date="$(date +'%Y-%m-%d')" +%s)
+ echo "$date_as_epoch,$jvm_type,$NGIGABYTES,$elapsed_time" >> $BENCHMARK_RESULTS_DIR/results.csv
rm -f $elapsed_time_file
}
diff --git a/update-results-db b/update-results-db
index d3d2815..41139ee 100755
--- a/update-results-db
+++ b/update-results-db
@@ -31,7 +31,7 @@ fi
rm -f $RESULTS_DB
sqlite3 $RESULTS_DB <<EOF
drop table if exists results;
-create table results (timestamp integer, jvm_type text, ngigabytes integer, elapsed_time integer);
+create table results (timestamp integer UNIQUE ON CONFLICT REPLACE, jvm_type text, ngigabytes integer, elapsed_time integer);
.separator ","
.import ${BENCHMARK_RESULTS_DIR}/results.csv results
EOF