graph-gophers / dataloader

Implementation of Facebook's DataLoader in Golang
MIT License
1.2k stars 75 forks source link

Metrics for cache hit rate etc. #100

Open deefdragon opened 1 year ago

deefdragon commented 1 year ago

The cache in dataloader alone is an incredibly useful tool for backing up requests, but one of the things that I am interested in with regards to the added complexity of a data loader is if the cache is being useful. Id like to track the hit-rate of my cache, but the current tracer does not provide enough information to inject metrics.

Would there be any way to add metrics tracking of some form? (I use prometheus metrics so direct support of those would be nice, but an adjustable interface like used for tracing would likely be better.)

eaglemoor commented 1 year ago

U need add metrics to your cache.