forked from phoenix/litellm-mirror
Merge pull request #4692 from BerriAI/ui_fix_cache_ratio_calc
[UI] Fix Cache Ratio Calc
This commit is contained in:
commit
b0a1ed72b1
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