aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-02-26 10:28:11 +0100
committerChocobozzz <me@florianbigard.com>2021-02-26 10:28:11 +0100
commit543442a3be9d7740749eb3918dc59f502ff042f9 (patch)
tree3d2959757b7907ea9be8a6f6a69d4bab8521dbc3 /server/tests
parentcb2e36618ca5986949d4326ea939b5b08f3a9a82 (diff)
downloadPeerTube-543442a3be9d7740749eb3918dc59f502ff042f9.tar.gz
PeerTube-543442a3be9d7740749eb3918dc59f502ff042f9.tar.zst
PeerTube-543442a3be9d7740749eb3918dc59f502ff042f9.zip
Add more AP stats to stats endpoint
It will help to understand if the federation correctly works or not
Diffstat (limited to 'server/tests')
-rw-r--r--server/tests/api/server/stats.ts17
1 files changed, 17 insertions, 0 deletions
diff --git a/server/tests/api/server/stats.ts b/server/tests/api/server/stats.ts
index 332c09585..eb474c1f5 100644
--- a/server/tests/api/server/stats.ts
+++ b/server/tests/api/server/stats.ts
@@ -21,6 +21,7 @@ import { waitJobs } from '../../../../shared/extra-utils/server/jobs'
21import { getStats } from '../../../../shared/extra-utils/server/stats' 21import { getStats } from '../../../../shared/extra-utils/server/stats'
22import { addVideoCommentThread } from '../../../../shared/extra-utils/videos/video-comments' 22import { addVideoCommentThread } from '../../../../shared/extra-utils/videos/video-comments'
23import { ServerStats } from '../../../../shared/models/server/server-stats.model' 23import { ServerStats } from '../../../../shared/models/server/server-stats.model'
24import { ActivityType } from '@shared/models'
24 25
25const expect = chai.expect 26const expect = chai.expect
26 27
@@ -201,6 +202,22 @@ describe('Test stats (excluding redundancy)', function () {
201 const second: ServerStats = res2.body 202 const second: ServerStats = res2.body
202 203
203 expect(second.totalActivityPubMessagesProcessed).to.be.greaterThan(first.totalActivityPubMessagesProcessed) 204 expect(second.totalActivityPubMessagesProcessed).to.be.greaterThan(first.totalActivityPubMessagesProcessed)
205 const apTypes: ActivityType[] = [
206 'Create', 'Update', 'Delete', 'Follow', 'Accept', 'Announce', 'Undo', 'Like', 'Reject', 'View', 'Dislike', 'Flag'
207 ]
208
209 const processed = apTypes.reduce(
210 (previous, type) => previous + second['totalActivityPub' + type + 'MessagesSuccesses'],
211 0
212 )
213 expect(second.totalActivityPubMessagesProcessed).to.equal(processed)
214 expect(second.totalActivityPubMessagesSuccesses).to.equal(processed)
215
216 expect(second.totalActivityPubMessagesErrors).to.equal(0)
217
218 for (const apType of apTypes) {
219 expect(second['totalActivityPub' + apType + 'MessagesErrors']).to.equal(0)
220 }
204 221
205 await wait(6000) 222 await wait(6000)
206 223