diff options
Diffstat (limited to '.github/workflows/benchmark.yml')
-rw-r--r-- | .github/workflows/benchmark.yml | 20 |
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 |