]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commit
Support video views/viewers stats in server
authorChocobozzz <me@florianbigard.com>
Thu, 24 Mar 2022 12:36:47 +0000 (13:36 +0100)
committerChocobozzz <chocobozzz@cpy.re>
Fri, 15 Apr 2022 07:49:35 +0000 (09:49 +0200)
commitb211106695bb82f6c32e53306081b5262c3d109d
treefa187de1c33b0956665f5362e29af6b0f6d8bb57
parent69d48ee30c9d47cddf0c3c047dc99a99dcb6e894
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
108 files changed:
config/default.yaml
config/production.yaml.example
config/test.yaml
package.json
scripts/benchmark.ts
scripts/ci.sh
server.ts
server/controllers/activitypub/client.ts
server/controllers/api/server/debug.ts
server/controllers/api/videos/index.ts
server/controllers/api/videos/stats.ts [new file with mode: 0644]
server/controllers/api/videos/view.ts [new file with mode: 0644]
server/controllers/api/videos/watching.ts [deleted file]
server/helpers/custom-validators/activitypub/activity.ts
server/helpers/custom-validators/activitypub/misc.ts
server/helpers/custom-validators/activitypub/videos.ts
server/helpers/custom-validators/activitypub/watch-action.ts [new file with mode: 0644]
server/helpers/custom-validators/video-stats.ts [new file with mode: 0644]
server/helpers/custom-validators/video-view.ts [new file with mode: 0644]
server/helpers/geo-ip.ts [new file with mode: 0644]
server/initializers/checker-before-init.ts
server/initializers/config.ts
server/initializers/constants.ts
server/initializers/database.ts
server/initializers/migrations/0705-local-video-viewers.ts [new file with mode: 0644]
server/lib/activitypub/activity.ts
server/lib/activitypub/context.ts
server/lib/activitypub/local-video-viewer.ts [new file with mode: 0644]
server/lib/activitypub/process/process-create.ts
server/lib/activitypub/process/process-view.ts
server/lib/activitypub/send/send-create.ts
server/lib/activitypub/send/send-view.ts
server/lib/activitypub/url.ts
server/lib/activitypub/videos/shared/object-to-model-attributes.ts
server/lib/client-html.ts
server/lib/job-queue/handlers/video-views-stats.ts
server/lib/redis.ts
server/lib/schedulers/geo-ip-update-scheduler.ts [new file with mode: 0644]
server/lib/schedulers/remove-old-views-scheduler.ts
server/lib/schedulers/video-views-buffer-scheduler.ts
server/lib/video-views.ts [deleted file]
server/lib/views/shared/index.ts [new file with mode: 0644]
server/lib/views/shared/video-viewers.ts [new file with mode: 0644]
server/lib/views/shared/video-views.ts [new file with mode: 0644]
server/lib/views/video-views-manager.ts [new file with mode: 0644]
server/middlewares/cache/shared/api-cache.ts
server/middlewares/validators/express.ts [new file with mode: 0644]
server/middlewares/validators/index.ts
server/middlewares/validators/videos/index.ts
server/middlewares/validators/videos/video-stats.ts [new file with mode: 0644]
server/middlewares/validators/videos/video-view.ts [new file with mode: 0644]
server/middlewares/validators/videos/video-watch.ts [deleted file]
server/models/video/formatter/video-format-utils.ts
server/models/video/video.ts
server/models/view/local-video-viewer-watch-section.ts [new file with mode: 0644]
server/models/view/local-video-viewer.ts [new file with mode: 0644]
server/models/view/video-view.ts [moved from server/models/video/video-view.ts with 96% similarity]
server/tests/api/activitypub/client.ts
server/tests/api/check-params/index.ts
server/tests/api/check-params/videos-history.ts
server/tests/api/check-params/views.ts [new file with mode: 0644]
server/tests/api/live/index.ts
server/tests/api/live/live-socket-messages.ts
server/tests/api/live/live-views.ts [deleted file]
server/tests/api/redundancy/redundancy.ts
server/tests/api/server/reverse-proxy.ts
server/tests/api/server/stats.ts
server/tests/api/videos/index.ts
server/tests/api/videos/multiple-servers.ts
server/tests/api/videos/single-server.ts
server/tests/api/videos/video-channels.ts
server/tests/api/videos/videos-history.ts
server/tests/api/views/index.ts [new file with mode: 0644]
server/tests/api/views/video-views-counter.ts [new file with mode: 0644]
server/tests/api/views/video-views-overall-stats.ts [new file with mode: 0644]
server/tests/api/views/video-views-retention-stats.ts [new file with mode: 0644]
server/tests/api/views/video-views-timeserie-stats.ts [new file with mode: 0644]
server/tests/api/views/videos-views-cleaner.ts [moved from server/tests/api/videos/videos-views-cleaner.ts with 90% similarity]
server/tests/plugins/action-hooks.ts
server/tests/plugins/plugin-helpers.ts
server/tests/shared/index.ts
server/tests/shared/views.ts [new file with mode: 0644]
server/types/express.d.ts
server/types/models/video/index.ts
server/types/models/video/local-video-viewer-watch-section.ts [new file with mode: 0644]
server/types/models/video/local-video-viewer.ts [new file with mode: 0644]
shared/models/activitypub/activity.ts
shared/models/activitypub/context.ts
shared/models/activitypub/objects/index.ts
shared/models/activitypub/objects/watch-action-object.ts [new file with mode: 0644]
shared/models/server/debug.model.ts
shared/models/users/index.ts
shared/models/users/user-watching-video.model.ts [deleted file]
shared/models/videos/index.ts
shared/models/videos/stats/index.ts [new file with mode: 0644]
shared/models/videos/stats/video-stats-overall.model.ts [new file with mode: 0644]
shared/models/videos/stats/video-stats-retention.model.ts [new file with mode: 0644]
shared/models/videos/stats/video-stats-timeserie-metric.type.ts [new file with mode: 0644]
shared/models/videos/stats/video-stats-timeserie.model.ts [new file with mode: 0644]
shared/models/videos/video-view.model.ts [new file with mode: 0644]
shared/models/videos/video.model.ts
shared/server-commands/server/server.ts
shared/server-commands/videos/history-command.ts
shared/server-commands/videos/index.ts
shared/server-commands/videos/video-stats-command.ts [new file with mode: 0644]
shared/server-commands/videos/videos-command.ts
shared/server-commands/videos/views-command.ts [new file with mode: 0644]
yarn.lock