More consistent log messages
This commit is contained in:
parent
cc737f6a9d
commit
ac26872341
@ -175,7 +175,7 @@ const processLogs = (stream) =>
|
|||||||
const ingestLogs = (zone, startSeconds, endSeconds) =>
|
const ingestLogs = (zone, startSeconds, endSeconds) =>
|
||||||
new Promise(resolve => {
|
new Promise(resolve => {
|
||||||
console.log(
|
console.log(
|
||||||
'LOG: start ingesting logs for %s from %s to %s',
|
'info: Started ingesting logs for %s from %s to %s',
|
||||||
zone.name,
|
zone.name,
|
||||||
stringifySeconds(startSeconds),
|
stringifySeconds(startSeconds),
|
||||||
stringifySeconds(endSeconds)
|
stringifySeconds(endSeconds)
|
||||||
@ -188,7 +188,7 @@ const ingestLogs = (zone, startSeconds, endSeconds) =>
|
|||||||
const endFetchTime = Date.now()
|
const endFetchTime = Date.now()
|
||||||
|
|
||||||
console.log(
|
console.log(
|
||||||
'LOG: fetched %ds worth of logs for %s in %dms',
|
'info: Fetched %ds worth of logs for %s in %dms',
|
||||||
endSeconds - startSeconds,
|
endSeconds - startSeconds,
|
||||||
zone.name,
|
zone.name,
|
||||||
endFetchTime - startFetchTime
|
endFetchTime - startFetchTime
|
||||||
@ -200,7 +200,7 @@ const ingestLogs = (zone, startSeconds, endSeconds) =>
|
|||||||
const endProcessTime = Date.now()
|
const endProcessTime = Date.now()
|
||||||
|
|
||||||
console.log(
|
console.log(
|
||||||
'LOG: processed %ds worth of logs for %s in %dms',
|
'info: Processed %ds worth of logs for %s in %dms',
|
||||||
endSeconds - startSeconds,
|
endSeconds - startSeconds,
|
||||||
zone.name,
|
zone.name,
|
||||||
endProcessTime - startProcessTime
|
endProcessTime - startProcessTime
|
||||||
@ -227,7 +227,7 @@ const startZone = (zone) => {
|
|||||||
startSeconds = minSeconds
|
startSeconds = minSeconds
|
||||||
} else if (startSeconds < minSeconds) {
|
} else if (startSeconds < minSeconds) {
|
||||||
console.warn(
|
console.warn(
|
||||||
'WARNING: dropped logs for %s from %s to %s!',
|
'warning: Dropped logs for %s from %s to %s!',
|
||||||
zone.name,
|
zone.name,
|
||||||
stringifySeconds(startSeconds),
|
stringifySeconds(startSeconds),
|
||||||
stringifySeconds(minSeconds)
|
stringifySeconds(minSeconds)
|
||||||
|
@ -64,7 +64,7 @@ const ingestStatsForZones = (zones, since, processDashboard) =>
|
|||||||
const zoneNames = zones.map(zone => zone.name).join(', ')
|
const zoneNames = zones.map(zone => zone.name).join(', ')
|
||||||
|
|
||||||
console.log(
|
console.log(
|
||||||
'LOG: start ingesting stats for zones %s since %d',
|
'info: Started ingesting stats for zones %s since %d',
|
||||||
zoneNames,
|
zoneNames,
|
||||||
since
|
since
|
||||||
)
|
)
|
||||||
@ -79,7 +79,7 @@ const ingestStatsForZones = (zones, since, processDashboard) =>
|
|||||||
const endFetchTime = Date.now()
|
const endFetchTime = Date.now()
|
||||||
|
|
||||||
console.log(
|
console.log(
|
||||||
'LOG: fetched zone analytics dashboards for %s since %d in %dms',
|
'info: Fetched zone analytics dashboards for %s since %d in %dms',
|
||||||
zoneNames,
|
zoneNames,
|
||||||
since,
|
since,
|
||||||
endFetchTime - startFetchTime
|
endFetchTime - startFetchTime
|
||||||
@ -96,7 +96,7 @@ const ingestStatsForZones = (zones, since, processDashboard) =>
|
|||||||
dashboard => {
|
dashboard => {
|
||||||
if (dashboard == null) {
|
if (dashboard == null) {
|
||||||
console.warn(
|
console.warn(
|
||||||
'WARNING: missing dashboards for %s since %d',
|
'warning: Missing dashboards for %s since %d',
|
||||||
zoneNames,
|
zoneNames,
|
||||||
since
|
since
|
||||||
)
|
)
|
||||||
@ -110,7 +110,7 @@ const ingestStatsForZones = (zones, since, processDashboard) =>
|
|||||||
const endProcessTime = Date.now()
|
const endProcessTime = Date.now()
|
||||||
|
|
||||||
console.log(
|
console.log(
|
||||||
'LOG: processed zone analytics dashboards for %s since %d in %dms',
|
'info: Processed zone analytics dashboards for %s since %d in %dms',
|
||||||
zoneNames,
|
zoneNames,
|
||||||
since,
|
since,
|
||||||
endProcessTime - startProcessTime
|
endProcessTime - startProcessTime
|
||||||
@ -134,12 +134,12 @@ const processPerDayTimeseries = (ts) =>
|
|||||||
|
|
||||||
invariant(
|
invariant(
|
||||||
since.getUTCHours() === 0 && since.getUTCMinutes() === 0 && since.getUTCSeconds() === 0,
|
since.getUTCHours() === 0 && since.getUTCMinutes() === 0 && since.getUTCSeconds() === 0,
|
||||||
'ERROR: per-day timeseries.since must begin exactly on the day'
|
'error: Per-day timeseries.since must begin exactly on the day'
|
||||||
)
|
)
|
||||||
|
|
||||||
invariant(
|
invariant(
|
||||||
(until - since) === oneDay,
|
(until - since) === oneDay,
|
||||||
'ERROR: per-day timeseries must span exactly one day'
|
'error: Per-day timeseries must span exactly one day'
|
||||||
)
|
)
|
||||||
|
|
||||||
const dayKey = createDayKey(since)
|
const dayKey = createDayKey(since)
|
||||||
@ -213,12 +213,12 @@ const processPerHourTimeseries = (ts) =>
|
|||||||
|
|
||||||
invariant(
|
invariant(
|
||||||
since.getUTCMinutes() === 0 && since.getUTCSeconds() === 0,
|
since.getUTCMinutes() === 0 && since.getUTCSeconds() === 0,
|
||||||
'ERROR: per-hour timeseries.since must begin exactly on the hour'
|
'error: Per-hour timeseries.since must begin exactly on the hour'
|
||||||
)
|
)
|
||||||
|
|
||||||
invariant(
|
invariant(
|
||||||
(until - since) === oneHour,
|
(until - since) === oneHour,
|
||||||
'ERROR: per-hour timeseries must span exactly one hour'
|
'error: Per-hour timeseries must span exactly one hour'
|
||||||
)
|
)
|
||||||
|
|
||||||
const hourKey = createHourKey(since)
|
const hourKey = createHourKey(since)
|
||||||
@ -251,12 +251,12 @@ const processPerMinuteTimeseries = (ts) =>
|
|||||||
|
|
||||||
invariant(
|
invariant(
|
||||||
since.getUTCSeconds() === 0,
|
since.getUTCSeconds() === 0,
|
||||||
'ERROR: per-minute timeseries.since must begin exactly on the minute'
|
'error: Per-minute timeseries.since must begin exactly on the minute'
|
||||||
)
|
)
|
||||||
|
|
||||||
invariant(
|
invariant(
|
||||||
(until - since) === oneMinute,
|
(until - since) === oneMinute,
|
||||||
'ERROR: per-minute timeseries must span exactly one minute'
|
'error: Per-minute timeseries must span exactly one minute'
|
||||||
)
|
)
|
||||||
|
|
||||||
const minuteKey = createMinuteKey(since)
|
const minuteKey = createMinuteKey(since)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user