aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/server-commands/server/metrics-command.ts
diff options
context:
space:
mode:
Diffstat (limited to 'shared/server-commands/server/metrics-command.ts')
-rw-r--r--shared/server-commands/server/metrics-command.ts18
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 @@
1import { HttpStatusCode, PlaybackMetricCreate } from '@shared/models'
2import { AbstractCommand, OverrideCommandOptions } from '../shared'
3
4export 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}