redis-rdb-tools icon indicating copy to clipboard operation
redis-rdb-tools copied to clipboard

future request: get total memory used by multiple keys via pattern

Open spccold opened this issue 8 years ago • 2 comments

Motivation:

most of time the keys in the same scene with the same key prefix and knows how many memory consumed in this scene is meaningful and helpful.

Result:

get total memory used by keys which start with 'keyprefix' rdb -c memory /var/redis/6379/dump.rdb --pattern 'keyprefix*'

spccold avatar Sep 17 '17 10:09 spccold

@sripathikrishnan What do you think?

spccold avatar Sep 17 '17 10:09 spccold

sripathikrishnan isn't active here anymore. i'm currently maintaining this repo, but i don't have much time to contribute either. looks like a good idea, it can be a subclass of the MemoryCallback class, which only sums the total memory rather than giving a detail report, and then allows the user to perform various types of filtering. here are some ideas:

  • filter by pattern like you suggested
  • filter by type (e.g. hash / set / etc)
  • sum only key names excluding values (or the other way around)

pull requests are welcome.

oranagra avatar Sep 17 '17 10:09 oranagra