Skip to content

Commit

Permalink
fix: add metrics for has cmd (#56)
Browse files Browse the repository at this point in the history
Signed-off-by: rfyiamcool <rfyiamcool@163.com>
  • Loading branch information
rfyiamcool authored Aug 5, 2023
1 parent 03e80e1 commit 689f110
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions db.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ func (db *DB) Get(key []byte) ([]byte, error) {
// Has returns true if the DB contains the given key.
func (db *DB) Has(key []byte) (bool, error) {
h := db.hash(key)
db.metrics.Gets.Add(1)
found := false
db.mu.RLock()
defer db.mu.RUnlock()
Expand Down

0 comments on commit 689f110

Please sign in to comment.