aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/views/video-views-manager.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-07-27 16:19:25 +0200
committerChocobozzz <me@florianbigard.com>2022-07-27 16:19:25 +0200
commitadc94cf09c86112051f72055852efcc977e4a04a (patch)
treeae6f25824c1e66004fa69aa9f685642d8d7ad8b4 /server/lib/views/video-views-manager.ts
parent50cc1ee48aacb6e7d6513c0f108492a589b515ea (diff)
downloadPeerTube-adc94cf09c86112051f72055852efcc977e4a04a.tar.gz
PeerTube-adc94cf09c86112051f72055852efcc977e4a04a.tar.zst
PeerTube-adc94cf09c86112051f72055852efcc977e4a04a.zip
Add live and viewers otel metrics
Diffstat (limited to 'server/lib/views/video-views-manager.ts')
-rw-r--r--server/lib/views/video-views-manager.ts9
1 files changed, 8 insertions, 1 deletions
diff --git a/server/lib/views/video-views-manager.ts b/server/lib/views/video-views-manager.ts
index 86758e8d8..c088dad5e 100644
--- a/server/lib/views/video-views-manager.ts
+++ b/server/lib/views/video-views-manager.ts
@@ -1,7 +1,7 @@
1import { logger, loggerTagsFactory } from '@server/helpers/logger' 1import { logger, loggerTagsFactory } from '@server/helpers/logger'
2import { MVideo, MVideoImmutable } from '@server/types/models' 2import { MVideo, MVideoImmutable } from '@server/types/models'
3import { VideoViewEvent } from '@shared/models' 3import { VideoViewEvent } from '@shared/models'
4import { VideoViewerCounters, VideoViewerStats, VideoViews } from './shared' 4import { VideoScope, VideoViewerCounters, VideoViewerStats, VideoViews, ViewerScope } from './shared'
5 5
6/** 6/**
7 * If processing a local view: 7 * If processing a local view:
@@ -79,6 +79,13 @@ export class VideoViewsManager {
79 return this.videoViewerCounters.getViewers(video) 79 return this.videoViewerCounters.getViewers(video)
80 } 80 }
81 81
82 getTotalViewers (options: {
83 viewerScope: ViewerScope
84 videoScope: VideoScope
85 }) {
86 return this.videoViewerCounters.getTotalViewers(options)
87 }
88
82 buildViewerExpireTime () { 89 buildViewerExpireTime () {
83 return this.videoViewerCounters.buildViewerExpireTime() 90 return this.videoViewerCounters.buildViewerExpireTime()
84 } 91 }