fix - select startTime and endTime on UI

This commit is contained in:
Ishaan Jaff 2024-05-03 21:20:19 -07:00
parent f7150cdba2
commit fccdb92c6b

View file

@ -7552,7 +7552,7 @@ async def model_metrics(
FROM FROM
"LiteLLM_SpendLogs" "LiteLLM_SpendLogs"
WHERE WHERE
"startTime" >= NOW() - INTERVAL '30 days' "startTime" BETWEEN $2::timestamp AND $3::timestamp
AND "model" = $1 AND "cache_hit" != 'True' AND "model" = $1 AND "cache_hit" != 'True'
GROUP BY GROUP BY
api_base, api_base,
@ -7653,6 +7653,8 @@ FROM
WHERE WHERE
"model" = $2 "model" = $2
AND "cache_hit" != 'True' AND "cache_hit" != 'True'
AND "startTime" >= $3::timestamp
AND "startTime" <= $4::timestamp
GROUP BY GROUP BY
api_base api_base
ORDER BY ORDER BY
@ -7660,7 +7662,7 @@ ORDER BY
""" """
db_response = await prisma_client.db.query_raw( db_response = await prisma_client.db.query_raw(
sql_query, alerting_threshold, _selected_model_group sql_query, alerting_threshold, _selected_model_group, startTime, endTime
) )
if db_response is not None: if db_response is not None: