diff options
Diffstat (limited to 'shared/server-commands/server/metrics-command.ts')
-rw-r--r-- | shared/server-commands/server/metrics-command.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/shared/server-commands/server/metrics-command.ts b/shared/server-commands/server/metrics-command.ts new file mode 100644 index 000000000..d22b4833d --- /dev/null +++ b/shared/server-commands/server/metrics-command.ts | |||
@@ -0,0 +1,18 @@ | |||
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 | } | ||