About your script, it sounds like a good idea to use scripting for
data sampling like that, however it could be more correct to pass the
pattern as argument and not as a key to EVAL.
More news soon,
Salvatore
> --
> You received this message because you are subscribed to the Google Groups
> "Redis DB" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/redis-db/-/uwzHSic7-mAJ.
> To post to this group, send email to redi...@googlegroups.com.
> To unsubscribe from this group, send email to
> redis-db+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/redis-db?hl=en.
--
Salvatore 'antirez' Sanfilippo
open source developer - VMware
http://invece.org
"We are what we repeatedly do. Excellence, therefore, is not an act,
but a habit." -- Aristotele
Salvatore
local pattern = KEYS[1]
local type_table = {}
type_table['set'] = 'scard'
type_table['zset'] = 'zcard'
type_table['list'] = 'llen'
type_table['hash'] = 'hlen'
type_table['string'] = 'strlen'
local stats = {}
local typ, command, len
for i,key in ipairs(redis.call('KEYS',pattern)) do
idletime = redis.call('object','idletime',key)
typ = redis.call('type',key)['ok']
command = type_table[typ]
len = 0
if command then
len = len + redis.call(command, key)
end
stats[i] = {key,typ,len,redis.call('ttl',key),
redis.call('object','encoding',key),
idletime}
end
return stats
> Of course! How could I not see that!?
It's very easy to overlook this stuff because the script as a "flow"
was gathering info. Just as a side effect was also changing this
info... :)
Keep an eye about shared integers! small integers will report OBJECT
IDLETIME that is "shared" across all the keys.
Salvatore