MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / Metrics

Method Metrics

driver/ipfs/db.go:258–283  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

256}
257
258func (db *DB) Metrics() (tit string, metrics []map[string]any) {
259 tit = "hybriddb cache"
260 costAdd := db.cache.Metrics.CostAdded()
261 costEvicted := db.cache.Metrics.CostEvicted()
262 metrics = []map[string]any{
263 {"used_cost": costAdd - costEvicted}, // Current memory usage (bytes)
264 {"cost_added": costAdd}, // Total memory sum of data added in history, incrementing (bytes)
265 {"cost_evicted": costEvicted}, // Free total memory, incrementing (bytes)
266 {"hits": db.cache.Metrics.Hits()}, // hits
267 {"misses": db.cache.Metrics.Misses()}, // misses
268 {"ratio": fmt.Sprintf("%.2f", db.cache.Metrics.Ratio())}, // hits / (hists + misses)
269 {"keys_added": db.cache.Metrics.KeysAdded()}, // number of keys added
270 {"keys_evicted": db.cache.Metrics.KeysEvicted()}, // delete key times
271 {"keys_updated": db.cache.Metrics.KeysUpdated()}, // update key times
272 {"gets_kept": db.cache.Metrics.GetsKept()}, // get total number of times the command is executed
273 // GetsDropped is the number of Get counter increments that are dropped
274 // internally.
275 {"gets_dropped": db.cache.Metrics.GetsDropped()},
276 // SetsDropped is the number of Set calls that don't make it into internal
277 // buffers (due to contention or some other reason).
278 {"sets_dropped": db.cache.Metrics.SetsDropped()},
279 // SetsRejected is the number of Set calls rejected by the policy (TinyLFU).
280 {"sets_rejected": db.cache.Metrics.SetsRejected()},
281 }
282 return
283}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected