qdone 2.0.50-alpha → 2.0.51-alpha

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,14 +10,17 @@ exports.getAggregateData = exports.interpretWildcard = exports.monitor = void 0;
10
10
  const sqs_js_1 = require("./sqs.js");
11
11
  const cloudWatch_js_1 = require("./cloudWatch.js");
12
12
  const defaults_js_1 = require("./defaults.js");
13
+ const qrlCache_js_1 = require("./qrlCache.js");
13
14
  const debug_1 = __importDefault(require("debug"));
14
- const debug = (0, debug_1.default)('sd:utils:qmonitor:index');
15
+ const debug = (0, debug_1.default)('qdone:monitor');
15
16
  /**
16
17
  * Splits a queue name with a single wildcard into prefix and suffix regex.
17
18
  */
18
19
  async function monitor(queue, save, options) {
19
20
  const opt = (0, defaults_js_1.getOptionsWithDefaults)(options);
20
- const data = await getAggregateData(queue);
21
+ const queueName = (0, qrlCache_js_1.normalizeQueueName)(queue, opt);
22
+ debug({ opt, queueName });
23
+ const data = await getAggregateData(queueName);
21
24
  console.log(data);
22
25
  if (save) {
23
26
  if (opt.verbose)
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "qdone",
3
- "version": "2.0.50-alpha",
3
+ "version": "2.0.51-alpha",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "qdone",
9
- "version": "2.0.50-alpha",
9
+ "version": "2.0.51-alpha",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@aws-sdk/client-cloudwatch": "3.465.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qdone",
3
- "version": "2.0.50-alpha",
3
+ "version": "2.0.51-alpha",
4
4
  "description": "A distributed scheduler for SQS",
5
5
  "type": "module",
6
6
  "main": "./index.js",
package/src/cli.js CHANGED
@@ -234,16 +234,8 @@ export async function monitor (argv) {
234
234
 
235
235
  // Load module after AWS global load
236
236
  setupAWS(options)
237
- const { getAggregateData } = await import('./monitor.js')
238
- const { putAggregateData } = await import('./cloudWatch.js')
239
- const data = await getAggregateData(queue)
240
- console.log(data)
241
- if (options.save) {
242
- process.stderr.write('Saving to CloudWatch...')
243
- await putAggregateData(data)
244
- process.stderr.write('done\n')
245
- }
246
- return data
237
+ const { monitor } = await import('./monitor.js')
238
+ return monitor(queue, options.save, options)
247
239
  }
248
240
 
249
241
  export async function loadBatchFile (filename) {
package/src/monitor.js CHANGED
@@ -5,15 +5,18 @@
5
5
  import { getMatchingQueues, getQueueAttributes } from './sqs.js'
6
6
  import { putAggregateData } from './cloudWatch.js'
7
7
  import { getOptionsWithDefaults } from './defaults.js'
8
+ import { normalizeQueueName } from './qrlCache.js'
8
9
  import Debug from 'debug'
9
- const debug = Debug('sd:utils:qmonitor:index')
10
+ const debug = Debug('qdone:monitor')
10
11
 
11
12
  /**
12
13
  * Splits a queue name with a single wildcard into prefix and suffix regex.
13
14
  */
14
15
  export async function monitor (queue, save, options) {
15
16
  const opt = getOptionsWithDefaults(options)
16
- const data = await getAggregateData(queue)
17
+ const queueName = normalizeQueueName(queue, opt)
18
+ debug({ opt, queueName })
19
+ const data = await getAggregateData(queueName)
17
20
  console.log(data)
18
21
  if (save) {
19
22
  if (opt.verbose) process.stderr.write('Saving to CloudWatch...')