Skip to content

Commit

Permalink
[client-app] Some final benchmark fixes
Browse files Browse the repository at this point in the history
Summary: See title

Test Plan: Run on the coffee machine

Reviewers: juan, evan, spang

Reviewed By: spang

Differential Revision: https://phab.nylas.com/D4368
  • Loading branch information
Mark Hahnenberg committed Apr 5, 2017
1 parent a89612d commit 3a37d0f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ scripts/sqlite

# Scripts for calculating statistics
scripts/toolbox
scripts/venv

# Python
*.pyc
Expand Down
12 changes: 11 additions & 1 deletion scripts/requirements.txt
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions scripts/run-once-per-day.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]]
Expand All @@ -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
Expand Down
4 changes: 3 additions & 1 deletion scripts/upload-benchmark-data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit 3a37d0f

Please sign in to comment.