bullmq
Version:
Queue for messages and jobs based on Redis
22 lines • 578 B
JavaScript
const content = `--[[
Get metrics
Input:
KEYS[1] 'metrics' key
KEYS[2] 'metrics data' key
ARGV[1] start index
ARGV[2] end index
]]
local rcall = redis.call;
local metricsKey = KEYS[1]
local dataKey = KEYS[2]
local metrics = rcall("HMGET", metricsKey, "count", "prevTS", "prevCount")
local data = rcall("LRANGE", dataKey, tonumber(ARGV[1]), tonumber(ARGV[2]))
local numPoints = rcall("LLEN", dataKey)
return {metrics, data, numPoints}
`;
export const getMetrics = {
name: 'getMetrics',
content,
keys: 2,
};
//# sourceMappingURL=getMetrics-2.js.map