mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-19 09:53:33 +00:00
fix(ui): cap sub-day rollup routing at 24 hours
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
10cc1d0192
commit
26f82f35db
1 changed files with 3 additions and 3 deletions
|
|
@ -8,11 +8,11 @@ export interface RelativeTimeOption {
|
|||
}
|
||||
|
||||
/** Widest window the sub-day (ClickHouse rollup) usage path serves; longer ranges use the daily tables. */
|
||||
export const SUB_DAY_MAX_RANGE_MS = 7 * 24 * 60 * 60 * 1000;
|
||||
export const SUB_DAY_MAX_RANGE_MS = 24 * 60 * 60 * 1000;
|
||||
|
||||
/**
|
||||
* A range that does not start at a local midnight is a sub-day investigation window
|
||||
* (Last 1h, 14:05 to 14:35): it is served from spend-log rollups and never snapped to day edges.
|
||||
* A window of at most 24 hours that does not start at a local midnight is a sub-day investigation
|
||||
* window (Last 1h, 14:05 to 14:35): it is served from spend-log rollups and never snapped to day edges.
|
||||
*/
|
||||
export const isSubDayRange = (from: Date, to: Date): boolean =>
|
||||
!moment(from).isSame(moment(from).startOf("day")) && to.getTime() - from.getTime() <= SUB_DAY_MAX_RANGE_MS;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue