local time = redis.call("TIME")
local threshold
if tonumber(ARGV[1]) == 1 then
threshold = tonumber(time[1]) * 1000000 + tonumber(time[2])
else
threshold = tonumber(time[1]) * 1000
end
local attrs = redis.call("HMGET", KEYS[1], "vt", "delay", "maxsize", "totalrecv", "totalsent", "created", "modified")
local msgs = redis.call("ZCARD", KEYS[2])
local hiddenmsgs = redis.call("ZCOUNT", KEYS[2], threshold, "+inf")
return {
time[1], time[2],
attrs[1], attrs[2], attrs[3], attrs[4], attrs[5], attrs[6], attrs[7],
msgs, hiddenmsgs
}