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
|
// set header cache statistics
|
||||||
setCachedResponses(valueFormatterNumbers(cache_hits));
|
setCachedResponses(valueFormatterNumbers(cache_hits));
|
||||||
setCachedTokens(valueFormatterNumbers(cached_tokens));
|
setCachedTokens(valueFormatterNumbers(cached_tokens));
|
||||||
if (llm_api_requests > 0) {
|
let allRequests = cache_hits + llm_api_requests
|
||||||
let cache_hit_ratio = ((cache_hits / llm_api_requests) * 100).toFixed(2);
|
if (allRequests > 0) {
|
||||||
|
let cache_hit_ratio = ((cache_hits / allRequests) * 100).toFixed(2);
|
||||||
setCacheHitRatio(cache_hit_ratio);
|
setCacheHitRatio(cache_hit_ratio);
|
||||||
} else {
|
} else {
|
||||||
setCacheHitRatio("0");
|
setCacheHitRatio("0");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue