Skip to content

Commit

Permalink
Instrument memory-store
Browse files Browse the repository at this point in the history
  • Loading branch information
frederikspang committed Aug 27, 2024
1 parent aa0d805 commit 4ed775a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions activesupport/lib/active_support/cache/memory_store.rb
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ def pruning?
# cache.increment("baz") # => 6
#
def increment(name, amount = 1, options = nil)
modify_value(name, amount, options)
instrument(:increment, name, amount: amount) do
modify_value(name, amount, options)
end
end

# Decrement a cached integer value. Returns the updated value.
Expand All @@ -162,7 +164,9 @@ def increment(name, amount = 1, options = nil)
# cache.decrement("baz") # => 4
#
def decrement(name, amount = 1, options = nil)
modify_value(name, -amount, options)
instrument(:decrement, name, amount: amount) do
modify_value(name, -amount, options)
end
end

# Deletes cache entries if the cache key matches a given pattern.
Expand Down

0 comments on commit 4ed775a

Please sign in to comment.