Since you mentioned redis-cli as an option, it has a build it function that does pretty much what you ask for (and much more).
redis-cli --bigkeys
Here is an example output:
Sampled 343799 keys in the keyspace! Total key length in bytes is 9556361 (avg len 27.80) Biggest string found '530f8dc7c7b3b:39:string:87929' has 500 bytes Biggest list found '530f8d5a17b26:9:list:11211' has 500 items Biggest set found '530f8da856e1e:75:set:65939' has 500 members Biggest hash found '530f8d619a0af:86:hash:16911' has 500 fields Biggest zset found '530f8d4a9ce31:45:zset:315' has 500 members 68559 strings with 17136672 bytes (19.94% of keys, avg size 249.96) 68986 lists with 17326343 items (20.07% of keys, avg size 251.16) 68803 sets with 17236635 members (20.01% of keys, avg size 250.52) 68622 hashs with 17272144 fields (19.96% of keys, avg size 251.70) 68829 zsets with 17241902 members (20.02% of keys, avg size 250.50)
You can view the full output example here
source share