Update logs worker
This commit is contained in:
parent
8138917d0b
commit
6659746b3d
|
@ -123,20 +123,20 @@ const computeLogChanges = (stream) =>
|
||||||
const date = new Date(Math.round(entry.timestamp / 1000000))
|
const date = new Date(Math.round(entry.timestamp / 1000000))
|
||||||
const dayKey = `${date.getUTCFullYear()}/${date.getUTCMonth()}/${date.getUTCDate()}`
|
const dayKey = `${date.getUTCFullYear()}/${date.getUTCMonth()}/${date.getUTCDate()}`
|
||||||
const hourKey = `${dayKey}/${date.getUTCHours()}`
|
const hourKey = `${dayKey}/${date.getUTCHours()}`
|
||||||
const minuteKey = `${hourKey}/${date.getUTCMinutes()}`
|
|
||||||
|
|
||||||
// Q: How many requests do we receive per day?
|
// Q: How many requests do we receive per day/hour?
|
||||||
incKey(`requestsPerDay/${dayKey}`)
|
incKey(`requestsPerDay/${dayKey}`)
|
||||||
|
incKey(`requestsPerHour/${hourKey}`)
|
||||||
|
|
||||||
// Q: How many requests do we receive per minute?
|
// Q: How many requests do we receive to edge/cache/origin per day/hour?
|
||||||
incKey(`requestsPerMinute/${minuteKey}`)
|
|
||||||
|
|
||||||
// Q: How many requests do we receive to edge/cache/origin per hour?
|
|
||||||
if (entry.origin) {
|
if (entry.origin) {
|
||||||
|
incKey(`originRequestsPerDay/${dayKey}`)
|
||||||
incKey(`originRequestsPerHour/${hourKey}`)
|
incKey(`originRequestsPerHour/${hourKey}`)
|
||||||
} else if (entry.cache) {
|
} else if (entry.cache) {
|
||||||
|
incKey(`cacheRequestsPerDay/${dayKey}`)
|
||||||
incKey(`cacheRequestsPerHour/${hourKey}`)
|
incKey(`cacheRequestsPerHour/${hourKey}`)
|
||||||
} else {
|
} else {
|
||||||
|
incKey(`edgeRequestsPerDay/${dayKey}`)
|
||||||
incKey(`edgeRequestsPerHour/${hourKey}`)
|
incKey(`edgeRequestsPerHour/${hourKey}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue