diff options
author | Chocobozzz <me@florianbigard.com> | 2020-12-15 13:34:58 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-12-15 13:34:58 +0100 |
commit | 99afa081bc6ae7f34b2105075bd43e3625434fa8 (patch) | |
tree | 0caea8591b3d3688a133cf33edcad616bf276375 /server/tests | |
parent | 48586fe070c2a59e9febb62a7f41ebb384e1d20e (diff) | |
download | PeerTube-99afa081bc6ae7f34b2105075bd43e3625434fa8.tar.gz PeerTube-99afa081bc6ae7f34b2105075bd43e3625434fa8.tar.zst PeerTube-99afa081bc6ae7f34b2105075bd43e3625434fa8.zip |
Add AP stats
Diffstat (limited to 'server/tests')
-rw-r--r-- | server/tests/api/server/stats.ts | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/server/tests/api/server/stats.ts b/server/tests/api/server/stats.ts index 0e77712cf..9f785a80e 100644 --- a/server/tests/api/server/stats.ts +++ b/server/tests/api/server/stats.ts | |||
@@ -176,6 +176,32 @@ describe('Test stats (excluding redundancy)', function () { | |||
176 | } | 176 | } |
177 | }) | 177 | }) |
178 | 178 | ||
179 | it('Should have the correct AP stats', async function () { | ||
180 | this.timeout(60000) | ||
181 | |||
182 | for (let i = 0; i < 10; i++) { | ||
183 | await uploadVideo(servers[0].url, servers[0].accessToken, { name: 'video' }) | ||
184 | } | ||
185 | |||
186 | const res1 = await getStats(servers[1].url) | ||
187 | const first = res1.body as ServerStats | ||
188 | |||
189 | await waitJobs(servers) | ||
190 | |||
191 | const res2 = await getStats(servers[1].url) | ||
192 | const second: ServerStats = res2.body | ||
193 | |||
194 | expect(second.totalActivityPubMessagesWaiting).to.equal(0) | ||
195 | expect(second.totalActivityPubMessagesProcessed).to.be.greaterThan(first.totalActivityPubMessagesProcessed) | ||
196 | |||
197 | await wait(5000) | ||
198 | |||
199 | const res3 = await getStats(servers[1].url) | ||
200 | const third: ServerStats = res3.body | ||
201 | |||
202 | expect(third.activityPubMessagesProcessedPerSecond).to.be.lessThan(second.activityPubMessagesProcessedPerSecond) | ||
203 | }) | ||
204 | |||
179 | after(async function () { | 205 | after(async function () { |
180 | await cleanupTests(servers) | 206 | await cleanupTests(servers) |
181 | }) | 207 | }) |