Review funkt
This commit is contained in:
21
node_modules/bullmq/dist/esm/scripts/getMetrics-2.js
generated
vendored
Normal file
21
node_modules/bullmq/dist/esm/scripts/getMetrics-2.js
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
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,
|
||||
};
|
||||
Reference in New Issue
Block a user