From 3a37d0f59fd2e68ed1d09bdb5202f6c86b6b8848 Mon Sep 17 00:00:00 2001 From: Mark Hahnenberg Date: Wed, 5 Apr 2017 15:34:13 -0700 Subject: [PATCH] [client-app] Some final benchmark fixes Summary: See title Test Plan: Run on the coffee machine Reviewers: juan, evan, spang Reviewed By: spang Differential Revision: https://phab.nylas.com/D4368 --- .gitignore | 1 + scripts/requirements.txt | 12 +++++++++++- scripts/run-once-per-day.sh | 3 +++ scripts/upload-benchmark-data.py | 4 +++- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 99d72e2659..211f836467 100644 --- a/.gitignore +++ b/.gitignore @@ -66,6 +66,7 @@ scripts/sqlite # Scripts for calculating statistics scripts/toolbox +scripts/venv # Python *.pyc diff --git a/scripts/requirements.txt b/scripts/requirements.txt index c32ba89ecb..0964f01c71 100644 --- a/scripts/requirements.txt +++ b/scripts/requirements.txt @@ -1,2 +1,12 @@ +appdirs==1.4.3 gspread==0.6.2 -dateutil==2.6.0 +httplib2==0.10.3 +oauth2client==4.0.0 +packaging==16.8 +pyasn1==0.2.3 +pyasn1-modules==0.0.8 +pyparsing==2.2.0 +python-dateutil==2.6.0 +requests==2.13.0 +rsa==3.4.2 +six==1.10.0 diff --git a/scripts/run-once-per-day.sh b/scripts/run-once-per-day.sh index 3280785e75..0fdfaccd24 100644 --- a/scripts/run-once-per-day.sh +++ b/scripts/run-once-per-day.sh @@ -6,6 +6,8 @@ CWD="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" BENCHMARK_SCRIPT=$CWD/benchmark-new-commits.sh +UPLOAD_SCRIPT=$CWD/upload-benchmark-data.py +BENCHMARK_RESULTS_DIR=$HOME/.benchmark_results TARGET_TIME="$1" if [[ $# != 1 ]] @@ -21,6 +23,7 @@ do if [[ $CURRENT_TIME = $TARGET_TIME ]] then /bin/bash $BENCHMARK_SCRIPT + python $UPLOAD_SCRIPT $BENCHMARK_RESULTS_DIR fi sleep 60 done diff --git a/scripts/upload-benchmark-data.py b/scripts/upload-benchmark-data.py index 3b8cfd6bdd..3606acf152 100644 --- a/scripts/upload-benchmark-data.py +++ b/scripts/upload-benchmark-data.py @@ -19,6 +19,8 @@ def usage(): def anymean(filename): output = subprocess.check_output(['./scripts/toolbox/any_mean.py', filename]) + if output == '': + return 0.0, 0.0 # e.g. 'Synced Messages: 77.00 +-0.00' synced_messages, confidence_interval = re.match('^Synced Messages: ([0-9.]+) (\+-[0-9.]+)$', output).groups() @@ -47,7 +49,7 @@ def update_spreadsheet(datadir): # TODO: might want to use the batch upload api in order to not run into rate-limits for i, new_row in enumerate(new_data): row_num = i+2 - existing_row = worksheet.range('A{row_num}:C{row_num}'.format(row_num=row_num)) + existing_row = worksheet.range('A{row_num}:D{row_num}'.format(row_num=row_num)) for j, cell in enumerate(existing_row): col_num = j+1 cell.value = new_row[j]