diff options
author | Chocobozzz <me@florianbigard.com> | 2022-07-27 16:19:25 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-07-27 16:19:25 +0200 |
commit | adc94cf09c86112051f72055852efcc977e4a04a (patch) | |
tree | ae6f25824c1e66004fa69aa9f685642d8d7ad8b4 /server/lib/views/video-views-manager.ts | |
parent | 50cc1ee48aacb6e7d6513c0f108492a589b515ea (diff) | |
download | PeerTube-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.ts | 9 |
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 @@ | |||
1 | import { logger, loggerTagsFactory } from '@server/helpers/logger' | 1 | import { logger, loggerTagsFactory } from '@server/helpers/logger' |
2 | import { MVideo, MVideoImmutable } from '@server/types/models' | 2 | import { MVideo, MVideoImmutable } from '@server/types/models' |
3 | import { VideoViewEvent } from '@shared/models' | 3 | import { VideoViewEvent } from '@shared/models' |
4 | import { VideoViewerCounters, VideoViewerStats, VideoViews } from './shared' | 4 | import { 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 | } |