From 82c2120614c23ff77f148a4ebe9b0995bc0835a4 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 22 Nov 2021 15:50:54 +0100 Subject: Add startup time benchmark --- .github/workflows/benchmark.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to '.github') diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 6682eb482..ee2a2b3a4 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -86,13 +86,29 @@ jobs: echo '{"clientBuildTime":'$clientBuildTime',"serverBuildTime":'$serverBuildTime'}'> build-time.json + - name: Startup + run: | + npm run clean:server:tests + + startCold=`date +%s` + NODE_APP_INSTANCE=1 NODE_ENV=test node dist/server --benchmark-startup + endCold=`date +%s` + coldStartupTime=$((endCold-startCold)) + + startHot=`date +%s` + NODE_APP_INSTANCE=1 NODE_ENV=test node dist/server --benchmark-startup + endHot=`date +%s` + hotStartupTime=$((endHot-startHot)) + + echo '{"coldStartupTime":'$coldStartupTime',"hotStartupTime":'$hotStartupTime'}'> startup-time.json + - name: Run benchmark run: | node dist/scripts/benchmark.js benchmark.json - name: Display result run: | - cat benchmark.json build-time.json + cat benchmark.json build-time.json startup-time.json - name: Upload benchmark result env: @@ -117,5 +133,5 @@ jobs: if [ ! -z ${STATS_DEPLOYEMENT_KEY+x} ]; then echo "Uploading files" - scp benchmark.json build-time.json ${STATS_DEPLOYEMENT_USER}@${STATS_DEPLOYEMENT_HOST}:../../web/peertube-stats; + scp benchmark.json build-time.json startup-time.json ${STATS_DEPLOYEMENT_USER}@${STATS_DEPLOYEMENT_HOST}:../../web/peertube-stats; fi -- cgit v1.2.3