From b211106695bb82f6c32e53306081b5262c3d109d Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 24 Mar 2022 13:36:47 +0100 Subject: Support video views/viewers stats in server * Add "currentTime" and "event" body params to view endpoint * Merge watching and view endpoints * Introduce WatchAction AP activity * Add tables to store viewer information of local videos * Add endpoints to fetch video views/viewers stats of local videos * Refactor views/viewers handlers * Support "views" and "viewers" counters for both VOD and live videos --- scripts/benchmark.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'scripts/benchmark.ts') diff --git a/scripts/benchmark.ts b/scripts/benchmark.ts index 623c11e27..4a414a2fa 100644 --- a/scripts/benchmark.ts +++ b/scripts/benchmark.ts @@ -153,21 +153,23 @@ async function run () { } }, { - title: 'API - watching', + title: 'API - views with token', method: 'PUT', headers: { ...buildAuthorizationHeader(), ...buildJSONHeader() }, body: JSON.stringify({ currentTime: 2 }), - path: '/api/v1/videos/' + video.uuid + '/watching', + path: '/api/v1/videos/' + video.uuid + '/views', expecter: (body, status) => { return status === 204 } }, { - title: 'API - views', + title: 'API - views without token', method: 'POST', + headers: buildJSONHeader(), + body: JSON.stringify({ currentTime: 2 }), path: '/api/v1/videos/' + video.uuid + '/views', expecter: (body, status) => { return status === 204 -- cgit v1.2.3