aboutsummaryrefslogtreecommitdiffhomepage
path: root/.github/workflows
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-11-22 15:50:54 +0100
committerChocobozzz <me@florianbigard.com>2021-11-22 15:51:28 +0100
commit82c2120614c23ff77f148a4ebe9b0995bc0835a4 (patch)
tree9ea03aaf20a28086404dc67e2e4f0fc75e6404fd /.github/workflows
parent1357df30c58c961d5da106648c1cdf37f2ea58aa (diff)
downloadPeerTube-82c2120614c23ff77f148a4ebe9b0995bc0835a4.tar.gz
PeerTube-82c2120614c23ff77f148a4ebe9b0995bc0835a4.tar.zst
PeerTube-82c2120614c23ff77f148a4ebe9b0995bc0835a4.zip
Add startup time benchmark
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/benchmark.yml20
1 files changed, 18 insertions, 2 deletions
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:
86 86
87 echo '{"clientBuildTime":'$clientBuildTime',"serverBuildTime":'$serverBuildTime'}'> build-time.json 87 echo '{"clientBuildTime":'$clientBuildTime',"serverBuildTime":'$serverBuildTime'}'> build-time.json
88 88
89 - name: Startup
90 run: |
91 npm run clean:server:tests
92
93 startCold=`date +%s`
94 NODE_APP_INSTANCE=1 NODE_ENV=test node dist/server --benchmark-startup
95 endCold=`date +%s`
96 coldStartupTime=$((endCold-startCold))
97
98 startHot=`date +%s`
99 NODE_APP_INSTANCE=1 NODE_ENV=test node dist/server --benchmark-startup
100 endHot=`date +%s`
101 hotStartupTime=$((endHot-startHot))
102
103 echo '{"coldStartupTime":'$coldStartupTime',"hotStartupTime":'$hotStartupTime'}'> startup-time.json
104
89 - name: Run benchmark 105 - name: Run benchmark
90 run: | 106 run: |
91 node dist/scripts/benchmark.js benchmark.json 107 node dist/scripts/benchmark.js benchmark.json
92 108
93 - name: Display result 109 - name: Display result
94 run: | 110 run: |
95 cat benchmark.json build-time.json 111 cat benchmark.json build-time.json startup-time.json
96 112
97 - name: Upload benchmark result 113 - name: Upload benchmark result
98 env: 114 env:
@@ -117,5 +133,5 @@ jobs:
117 133
118 if [ ! -z ${STATS_DEPLOYEMENT_KEY+x} ]; then 134 if [ ! -z ${STATS_DEPLOYEMENT_KEY+x} ]; then
119 echo "Uploading files" 135 echo "Uploading files"
120 scp benchmark.json build-time.json ${STATS_DEPLOYEMENT_USER}@${STATS_DEPLOYEMENT_HOST}:../../web/peertube-stats; 136 scp benchmark.json build-time.json startup-time.json ${STATS_DEPLOYEMENT_USER}@${STATS_DEPLOYEMENT_HOST}:../../web/peertube-stats;
121 fi 137 fi