From cacccbe23d641bdd7de3f73fa4effb2caf70d473 Mon Sep 17 00:00:00 2001 From: HF Date: Sun, 3 Apr 2022 18:24:57 +0200 Subject: [PATCH] log slow redis chunk requests --- src/routes/chunks.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/routes/chunks.js b/src/routes/chunks.js index 5bd6a14..aaf669b 100644 --- a/src/routes/chunks.js +++ b/src/routes/chunks.js @@ -42,7 +42,13 @@ export default async (req: Request, res: Response, next) => { // divided in height, which is not used yet // - this is not used and probably won't ever be used try { + const stime = Date.now(); chunk = await RedisCanvas.getChunk(c, x, y, z); + const dur = Date.now() - stime; + if (dur > 1000) { + // eslint-disable-next-line max-len + logger.warn(`Long redis response times of ${dur}ms for chunk ${c}:${x},${y},${z}`); + } } catch { res.status(503).end(); return;