u
This commit is contained in:
19
src/api/health.js
Normal file
19
src/api/health.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import { http } from './http.js';
|
||||
|
||||
/**
|
||||
* Health API for backend latency samples.
|
||||
*/
|
||||
export const health = {
|
||||
/**
|
||||
* GET /api/health/latency?range=3h|all
|
||||
* Returns: 200 { raw: Point[] } for '3h', { raw, avg, max } for 'all'.
|
||||
* Point = { timestamp: epoch ms, value: latency ms }, sorted oldest first.
|
||||
* @param {'3h'|'all'} [range='3h']
|
||||
*/
|
||||
// #region GET /api/health/latency — getLatency
|
||||
// MARK: calls GET /api/health/latency from ./api/index.js
|
||||
getLatency(range = '3h') {
|
||||
return http(`/api/health/latency?range=${encodeURIComponent(range)}`);
|
||||
},
|
||||
// #endregion
|
||||
};
|
||||
@@ -33,3 +33,4 @@ export { account } from './account.js';
|
||||
export { mcp } from './mcp.js';
|
||||
export { backup } from './backup.js';
|
||||
export { carrier } from './carrier.js';
|
||||
export { health } from './health.js';
|
||||
|
||||
Reference in New Issue
Block a user