diff options
author | Andrew McDermott <andrew.mcdermott@linaro.org> | 2014-05-19 09:55:11 +0100 |
---|---|---|
committer | Andrew McDermott <andrew.mcdermott@linaro.org> | 2014-05-19 09:55:11 +0100 |
commit | 21fa13e1ba2b9e99307627dc815102a97bdc563c (patch) | |
tree | fdbb2d8bc0fdce9054e72ff9de2852e3903c6fba | |
parent | 3ac363e2e2fe182dbcae13bb88822fad1e22cbb2 (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-x | benchmark-terasort | 3 | ||||
-rwxr-xr-x | update-results-db | 2 |
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 |