Replaced GetEmbeddingCacheSize with GetStats, fixed long loading times for front-end stats retrieval

This commit is contained in:
2026-01-02 02:04:19 +01:00
parent 09832d1c0b
commit aa4fc03c3d
9 changed files with 140 additions and 76 deletions

View File

@@ -339,4 +339,16 @@ public class Searchdomain
{
searchCache = [];
}
public long GetSearchCacheSize()
{
long sizeInBytes = 0;
foreach (var entry in searchCache)
{
sizeInBytes += sizeof(int); // string length prefix
sizeInBytes += entry.Key.Length * sizeof(char); // string characters
sizeInBytes += entry.Value.EstimateSize();
}
return sizeInBytes;
}
}