mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 11:43:54 +00:00
fix cache ratio calc
This commit is contained in:
parent
8203174faf
commit
744deaec75
1 changed files with 3 additions and 2 deletions
|
@ -194,8 +194,9 @@ const CacheDashboard: React.FC<CachePageProps> = ({
|
|||
// set header cache statistics
|
||||
setCachedResponses(valueFormatterNumbers(cache_hits));
|
||||
setCachedTokens(valueFormatterNumbers(cached_tokens));
|
||||
if (llm_api_requests > 0) {
|
||||
let cache_hit_ratio = ((cache_hits / llm_api_requests) * 100).toFixed(2);
|
||||
let allRequests = cache_hits + llm_api_requests
|
||||
if (allRequests > 0) {
|
||||
let cache_hit_ratio = ((cache_hits / allRequests) * 100).toFixed(2);
|
||||
setCacheHitRatio(cache_hit_ratio);
|
||||
} else {
|
||||
setCacheHitRatio("0");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue