blob: 80acd7bdc69fdf66b75714a50634a2f2358a7d73 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
import { HttpStatusCode, ServerStats } from '@peertube/peertube-models'
import { AbstractCommand, OverrideCommandOptions } from '../shared/index.js'
export class StatsCommand extends AbstractCommand {
get (options: OverrideCommandOptions & {
useCache?: boolean // default false
} = {}) {
const { useCache = false } = options
const path = '/api/v1/server/stats'
const query = {
t: useCache ? undefined : new Date().getTime()
}
return this.getRequestBody<ServerStats>({
...options,
path,
query,
implicitToken: false,
defaultExpectedStatus: HttpStatusCode.OK_200
})
}
}
|