Skip to content

Commit

Permalink
add stats method on RedisCacheStore similar to MemCacheStore
Browse files Browse the repository at this point in the history
  • Loading branch information
ritikesh committed Dec 29, 2020
1 parent 96446a9 commit c8934f3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions activesupport/CHANGELOG.md
Expand Up @@ -6,5 +6,9 @@

*Ritikesh G*

* add `RedisCacheStore#stats` method similar to `MemCacheStore#stats`. Calls `redis#info` internally.

*Ritikesh G*


Please check [6-1-stable](https://github.com/rails/rails/blob/6-1-stable/activesupport/CHANGELOG.md) for previous changes.
5 changes: 5 additions & 0 deletions activesupport/lib/active_support/cache/redis_cache_store.rb
Expand Up @@ -319,6 +319,11 @@ def clear(options = nil)
end
end

# Get info from redis servers.
def stats
redis.with { |c| c.info }
end

def mget_capable? #:nodoc:
set_redis_capabilities unless defined? @mget_capable
@mget_capable
Expand Down

0 comments on commit c8934f3

Please sign in to comment.