]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - shared/server-commands/server/metrics-command.ts
Bumped to version v5.2.1
[github/Chocobozzz/PeerTube.git] / shared / server-commands / server / metrics-command.ts
1 import { HttpStatusCode, PlaybackMetricCreate } from '@shared/models'
2 import { AbstractCommand, OverrideCommandOptions } from '../shared'
3
4 export class MetricsCommand extends AbstractCommand {
5
6 addPlaybackMetric (options: OverrideCommandOptions & { metrics: PlaybackMetricCreate }) {
7 const path = '/api/v1/metrics/playback'
8
9 return this.postBodyRequest({
10 ...options,
11
12 path,
13 fields: options.metrics,
14 implicitToken: false,
15 defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204
16 })
17 }
18 }