From 5f7cdbf8d97515f1bf36bbe8067fa0f3796f66d0 Mon Sep 17 00:00:00 2001 From: Liam Date: Thu, 16 Nov 2023 19:31:44 +0000 Subject: [PATCH] fix --- apps/proxy/src/routes/proxy.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/apps/proxy/src/routes/proxy.ts b/apps/proxy/src/routes/proxy.ts index 532b1c1..8825e3e 100644 --- a/apps/proxy/src/routes/proxy.ts +++ b/apps/proxy/src/routes/proxy.ts @@ -81,14 +81,16 @@ async function logRequestToDatabase({ { upsert: true } ).exec(); - const point = new Point("proxy"); - point.tag("type", "request"); - point.tag("node", nodeId); - point.stringField("url", url); - point.intField("status", status); + const point = new Point("proxy") + .tag("type", "request") + .tag("node", nodeId) + .stringField("url", url) + .intField("status", status) + .timestamp(Date.now()); if (cached) { point.tag("cached", "true"); - } else { + } + if (time) { point.intField("time", time as number); } try {