mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-07 06:03:09 -06:00
Estimate cost for metrics better
This commit is contained in:
parent
2425354b6d
commit
e4ccddf5b7
|
|
@ -35,8 +35,7 @@ func NewRistrettoCache(maxCost CacheSize, enablePrometheus bool) (*Caches, error
|
||||||
Subsystem: "caching_ristretto",
|
Subsystem: "caching_ristretto",
|
||||||
Name: "cost",
|
Name: "cost",
|
||||||
}, func() float64 {
|
}, func() float64 {
|
||||||
evicted := cache.Metrics.CostEvicted() + cache.Metrics.CostEvicted()
|
return float64(cache.Metrics.CostAdded() - cache.Metrics.CostEvicted())
|
||||||
return float64(cache.Metrics.CostAdded() - evicted)
|
|
||||||
})
|
})
|
||||||
return &Caches{
|
return &Caches{
|
||||||
RoomVersions: &RistrettoCachePartition[string, gomatrixserverlib.RoomVersion]{
|
RoomVersions: &RistrettoCachePartition[string, gomatrixserverlib.RoomVersion]{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue