INFO.js 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.transformReply = exports.transformArguments = exports.IS_READ_ONLY = exports.FIRST_KEY_INDEX = void 0;
  4. exports.FIRST_KEY_INDEX = 1;
  5. exports.IS_READ_ONLY = true;
  6. function transformArguments(key) {
  7. return ['TS.INFO', key];
  8. }
  9. exports.transformArguments = transformArguments;
  10. function transformReply(reply) {
  11. return {
  12. totalSamples: reply[1],
  13. memoryUsage: reply[3],
  14. firstTimestamp: reply[5],
  15. lastTimestamp: reply[7],
  16. retentionTime: reply[9],
  17. chunkCount: reply[11],
  18. chunkSize: reply[13],
  19. chunkType: reply[15],
  20. duplicatePolicy: reply[17],
  21. labels: reply[19].map(([name, value]) => ({
  22. name,
  23. value
  24. })),
  25. sourceKey: reply[21],
  26. rules: reply[23].map(([key, timeBucket, aggregationType]) => ({
  27. key,
  28. timeBucket,
  29. aggregationType
  30. }))
  31. };
  32. }
  33. exports.transformReply = transformReply;