UBERF-6374: Improve server logging and improve startup performance (#5210)

This commit is contained in:
Andrey Sobolev
2024-04-06 15:14:06 +07:00
committed by GitHub
parent ceac67f3a3
commit 034700a65b
39 changed files with 631 additions and 405 deletions
+3 -2
View File
@@ -292,7 +292,9 @@ export function start (
const token = req.query.token as string
const payload = decodeToken(token)
const admin = payload.extra?.admin === 'true'
res.writeHead(200, { 'Content-Type': 'application/json' })
res.status(200)
res.setHeader('Content-Type', 'application/json')
res.setHeader('Cache-Control', cacheControlNoCache)
const json = JSON.stringify({
metrics: metricsAggregate((ctx as any).metrics),
@@ -301,7 +303,6 @@ export function start (
},
admin
})
res.set('Cache-Control', 'private, no-cache')
res.end(json)
} catch (err) {
console.error(err)