getMetrics-2.js 679 B

12345678910111213141516171819202122232425
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.getMetrics = void 0;
  4. const content = `--[[
  5. Get metrics
  6. Input:
  7. KEYS[1] 'metrics' key
  8. KEYS[2] 'metrics data' key
  9. ARGV[1] start index
  10. ARGV[2] end index
  11. ]]
  12. local rcall = redis.call;
  13. local metricsKey = KEYS[1]
  14. local dataKey = KEYS[2]
  15. local metrics = rcall("HMGET", metricsKey, "count", "prevTS", "prevCount")
  16. local data = rcall("LRANGE", dataKey, tonumber(ARGV[1]), tonumber(ARGV[2]))
  17. local numPoints = rcall("LLEN", dataKey)
  18. return {metrics, data, numPoints}
  19. `;
  20. exports.getMetrics = {
  21. name: 'getMetrics',
  22. content,
  23. keys: 2,
  24. };
  25. //# sourceMappingURL=getMetrics-2.js.map