mirror of
https://github.com/fosrl/pangolin.git
synced 2026-08-01 10:11:27 +02:00
remove time logs
This commit is contained in:
@@ -41,7 +41,6 @@ export async function getCachedStatusHistory(
|
|||||||
return cached;
|
return cached;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.time(`[getCachedStatusHistory/${entityType}=${entityId}]`);
|
|
||||||
// Anchor to local midnight (UTC when tzOffsetMinutes is 0) so the query
|
// Anchor to local midnight (UTC when tzOffsetMinutes is 0) so the query
|
||||||
// window aligns with stable calendar days for the requesting client
|
// window aligns with stable calendar days for the requesting client
|
||||||
const todayMidnightSec = localMidnightSec(tzOffsetMinutes);
|
const todayMidnightSec = localMidnightSec(tzOffsetMinutes);
|
||||||
@@ -77,14 +76,12 @@ export async function getCachedStatusHistory(
|
|||||||
|
|
||||||
const priorStatus = lastKnownEvent?.status ?? null;
|
const priorStatus = lastKnownEvent?.status ?? null;
|
||||||
|
|
||||||
console.time(`[computeBuckets/${entityType}=${entityId}]`);
|
|
||||||
const { buckets, totalDowntime } = computeBuckets(
|
const { buckets, totalDowntime } = computeBuckets(
|
||||||
events,
|
events,
|
||||||
days,
|
days,
|
||||||
priorStatus,
|
priorStatus,
|
||||||
tzOffsetMinutes
|
tzOffsetMinutes
|
||||||
);
|
);
|
||||||
console.timeEnd(`[computeBuckets/${entityType}=${entityId}]`);
|
|
||||||
const totalWindow = days * 86400;
|
const totalWindow = days * 86400;
|
||||||
const overallUptime =
|
const overallUptime =
|
||||||
totalWindow > 0
|
totalWindow > 0
|
||||||
@@ -99,7 +96,6 @@ export async function getCachedStatusHistory(
|
|||||||
totalDowntimeSeconds: totalDowntime
|
totalDowntimeSeconds: totalDowntime
|
||||||
};
|
};
|
||||||
|
|
||||||
console.timeEnd(`[getCachedStatusHistory/${entityType}=${entityId}]`);
|
|
||||||
await cache.set(cacheKey, result, STATUS_HISTORY_CACHE_TTL);
|
await cache.set(cacheKey, result, STATUS_HISTORY_CACHE_TTL);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -317,10 +313,6 @@ export async function getBatchedStatusHistory(
|
|||||||
days: number,
|
days: number,
|
||||||
tzOffsetMinutes: number = 0
|
tzOffsetMinutes: number = 0
|
||||||
): Promise<BatchedStatusHistoryResponse> {
|
): Promise<BatchedStatusHistoryResponse> {
|
||||||
console.time(
|
|
||||||
`[getBatchedStatusHistory/${entityType}=(${entityIds.join(" ,")})]`
|
|
||||||
);
|
|
||||||
|
|
||||||
// Anchor to local midnight (UTC when tzOffsetMinutes is 0) so the query
|
// Anchor to local midnight (UTC when tzOffsetMinutes is 0) so the query
|
||||||
// window aligns with stable calendar days for the requesting client
|
// window aligns with stable calendar days for the requesting client
|
||||||
const todayMidnightSec = localMidnightSec(tzOffsetMinutes);
|
const todayMidnightSec = localMidnightSec(tzOffsetMinutes);
|
||||||
@@ -398,7 +390,6 @@ export async function getBatchedStatusHistory(
|
|||||||
|
|
||||||
const result: BatchedStatusHistoryResponse = {};
|
const result: BatchedStatusHistoryResponse = {};
|
||||||
|
|
||||||
console.time(`[computeBuckets/${entityType}=(${entityIds.join(" ,")})]`);
|
|
||||||
for (const entityId in eventStatusMap) {
|
for (const entityId in eventStatusMap) {
|
||||||
const event = eventStatusMap[Number(entityId)];
|
const event = eventStatusMap[Number(entityId)];
|
||||||
const priorStatus = event.lastKnownEvent?.status ?? null;
|
const priorStatus = event.lastKnownEvent?.status ?? null;
|
||||||
@@ -426,10 +417,5 @@ export async function getBatchedStatusHistory(
|
|||||||
totalDowntimeSeconds: totalDowntime
|
totalDowntimeSeconds: totalDowntime
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
console.timeEnd(`[computeBuckets/${entityType}=(${entityIds.join(" ,")})]`);
|
|
||||||
|
|
||||||
console.timeEnd(
|
|
||||||
`[getBatchedStatusHistory/${entityType}=(${entityIds.join(" ,")})]`
|
|
||||||
);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user