Something went wrong. Try again.
Atmosphere Status dashboard page
Something went wrong. Try again.
759 B · 27 lines
TypeScript
at master
12345678910111213141516171819202122232425262728export const SLOW_REQUEST_THRESHOLD_SECONDS = 15;
export function timeIntervalText(interval: number): string { let seconds = Math.max(0, Math.floor(interval / 1_000)); let value: number; let unit: string;
if (seconds < 60) { value = seconds; unit = 'second'; } else if (seconds < 60 * 60) { value = Math.floor(seconds / 60); unit = 'minute'; } else if (seconds < 24 * 60 * 60) { value = Math.floor(seconds / (60 * 60)); unit = 'hour'; } else { value = Math.floor(seconds / (24 * 60 * 60)); unit = 'day'; }
return `${value} ${unit}${value === 1 ? '' : 's'}`;}
export function isRecord(value: unknown): value is JsonRecord { return typeof value === 'object' && value !== null && !Array.isArray(value);}