metrics: interval is not configurable, unnecessary

This commit is contained in:
Girish Ramakrishnan
2025-07-04 23:20:13 +02:00
parent fb02bdb445
commit 2317c17b4b
5 changed files with 12 additions and 17 deletions

View File

@@ -134,10 +134,7 @@ async function getMetrics(req, res, next) {
async function getMetricStream(req, res, next) {
if (req.headers.accept !== 'text/event-stream') return next(new HttpError(400, 'This API call requires EventStream'));
const intervalMsecs = typeof req.query.intervalMsecs !== 'undefined' ? parseInt(req.query.intervalMsecs, 10) : 5000;
if (!intervalMsecs || intervalMsecs < 100) return next(new HttpError(400, 'intervalSecs query param must be atleast 100'));
const [error, metricStream] = await safe(metrics.getSystemStream({ intervalMsecs }));
const [error, metricStream] = await safe(metrics.getSystemStream({}));
if (error) return next(BoxError.toHttpError(error));
res.writeHead(200, {