Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions entity_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,19 @@ func New(
if err != nil {
return nil, err
}
pr := prometheus.NewCounterVec(
prometheus.CounterOpts{
Name: promMetricName,
Help: "A counter of hit/miss on the entity cache.",
},
[]string{"namespace", "hit"},
)
prometheus.MustRegister(pr)
return &EntityCache{
promHitCounter: prometheus.NewCounterVec(
prometheus.CounterOpts{
Name: promMetricName,
Help: "A counter of hit/miss on the entity cache.",
},
[]string{"namespace", "hit"},
),

maxEntries: maxEntries,
ttr: ttr,
ttl: ttl,
promHitCounter: pr,
maxEntries: maxEntries,
ttr: ttr,
ttl: ttl,

cache: cache,
locker: locker.NewEntityLocker(),
Expand Down
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/solher/entitycache
module github.com/justwatch/entitycache

go 1.21.0

Expand All @@ -22,3 +22,5 @@ require (
golang.org/x/sys v0.8.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
)

replace github.com/solher/entitycache => github.com/justwatch/entitycache v0.0.0-20240229045341-55dfa11564a7