mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-10 17:48:50 +08:00
[client-app] Add script that benchmarks new commits
Summary: We want to setup the initial sync benchmark to run automatically with each commit on a separate machine. This script does just that and dumps the results to a directory. We can then have a separate script process them and upload them to whichever service we want. Test Plan: Run locally Reviewers: evan, spang, juan Reviewed By: juan Differential Revision: https://phab.nylas.com/D4296
This commit is contained in:
parent
5c08018382
commit
9270ff6c4c
1 changed files with 28 additions and 0 deletions
28
scripts/benchmark-new-commits.sh
Normal file
28
scripts/benchmark-new-commits.sh
Normal file
|
@ -0,0 +1,28 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
function get_next_commit() {
|
||||
local LAST_COMMIT=$1
|
||||
local NEXT_COMMIT=$(git log master ^$LAST_COMMIT --ancestry-path --pretty=oneline | cut -d" " -f1 | tail -n 1)
|
||||
echo "$NEXT_COMMIT"
|
||||
}
|
||||
|
||||
BENCHMARK_RESULTS_DIR="$HOME/.benchmark_results"
|
||||
mkdir -p $BENCHMARK_RESULTS_DIR
|
||||
|
||||
CWD="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
LAST_COMMIT=$(cat $BENCHMARK_RESULTS_DIR/last_commit)
|
||||
NEXT_COMMIT=$(get_next_commit $LAST_COMMIT)
|
||||
|
||||
git checkout -q master
|
||||
git pull -q --rebase
|
||||
|
||||
while [[ $NEXT_COMMIT != '' ]]
|
||||
do
|
||||
echo $NEXT_COMMIT
|
||||
git checkout -q $NEXT_COMMIT
|
||||
bash $CWD/benchmark-initial-sync.sh > "$BENCHMARK_RESULTS_DIR/$NEXT_COMMIT-results.txt"
|
||||
echo "$NEXT_COMMIT" > "$BENCHMARK_RESULTS_DIR/last_commit"
|
||||
NEXT_COMMIT=$(get_next_commit $NEXT_COMMIT)
|
||||
done
|
Loading…
Reference in a new issue