2018-11-19 11:08:18 -05:00
|
|
|
import { makeGetRequest } from '../requests/requests'
|
2020-12-07 08:32:36 -05:00
|
|
|
import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
|
2018-02-28 12:04:46 -05:00
|
|
|
|
2018-09-14 08:57:59 -04:00
|
|
|
function getStats (url: string, useCache = false) {
|
2018-02-28 12:04:46 -05:00
|
|
|
const path = '/api/v1/server/stats'
|
|
|
|
|
2018-09-14 08:57:59 -04:00
|
|
|
const query = {
|
|
|
|
t: useCache ? undefined : new Date().getTime()
|
|
|
|
}
|
|
|
|
|
2018-02-28 12:04:46 -05:00
|
|
|
return makeGetRequest({
|
|
|
|
url,
|
|
|
|
path,
|
2018-09-14 08:57:59 -04:00
|
|
|
query,
|
2020-12-07 08:32:36 -05:00
|
|
|
statusCodeExpected: HttpStatusCode.OK_200
|
2018-02-28 12:04:46 -05:00
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
export {
|
|
|
|
getStats
|
|
|
|
}
|