qdone 2.0.49-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.
- package/commonjs/src/defaults.js +38 -37
- package/commonjs/src/monitor.js +5 -2
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/src/cli.js +2 -10
- package/src/defaults.js +38 -37
- package/src/monitor.js +5 -2
package/commonjs/src/defaults.js
CHANGED
|
@@ -48,7 +48,8 @@ exports.defaults = Object.freeze({
|
|
|
48
48
|
delete: false,
|
|
49
49
|
unpair: false,
|
|
50
50
|
// Check
|
|
51
|
-
create: false
|
|
51
|
+
create: false,
|
|
52
|
+
overwrite: false
|
|
52
53
|
});
|
|
53
54
|
function validateInteger(opt, name) {
|
|
54
55
|
const parsed = parseInt(opt[name], 10);
|
|
@@ -87,50 +88,50 @@ function getOptionsWithDefaults(options) {
|
|
|
87
88
|
const dlq = options.dlq || !!(options['dlq-suffix'] || options['dlq-after'] || options['dlq-name'] || options.dlqSuffix || options.dlqAfter || options.dlqName);
|
|
88
89
|
const opt = {
|
|
89
90
|
// Shared
|
|
90
|
-
prefix: options.prefix === '' ? options.prefix : (options.prefix || exports.defaults.prefix),
|
|
91
|
-
failSuffix: options.failSuffix || options['fail-suffix'] || exports.defaults.failSuffix,
|
|
92
|
-
region: options.region || process.env.AWS_REGION || exports.defaults.region,
|
|
93
|
-
quiet: options.quiet || exports.defaults.quiet,
|
|
94
|
-
verbose: options.verbose || exports.defaults.verbose,
|
|
95
|
-
fifo: options.fifo || exports.defaults.fifo,
|
|
96
|
-
sentryDsn: options.sentryDsn || options['sentry-dsn'],
|
|
97
|
-
disableLog: options.disableLog || options['disable-log'] || exports.defaults.disableLog,
|
|
98
|
-
includeFailed: options.includeFailed || options['include-failed'] || exports.defaults.includeFailed,
|
|
99
|
-
includeDead: options.includeDead || options['include-dead'] || exports.defaults.includeDead,
|
|
100
|
-
externalDedup: options.externalDedup || options['external-dedup'] || exports.defaults.externalDedup,
|
|
101
|
-
dedupPeriod: options.dedupPeriod || options['dedup-period'] || exports.defaults.dedupPeriod,
|
|
102
|
-
dedupStats: options.dedupStats || options['dedup-stats'] || exports.defaults.dedupStats,
|
|
91
|
+
prefix: options.prefix === '' ? options.prefix : (options.prefix || process.env.QDONE_PREFIX || exports.defaults.prefix),
|
|
92
|
+
failSuffix: options.failSuffix || options['fail-suffix'] || process.env.QDONE_FAIL_SUFFIX || exports.defaults.failSuffix,
|
|
93
|
+
region: options.region || process.env.QDONE_REGION || process.env.AWS_REGION || exports.defaults.region,
|
|
94
|
+
quiet: options.quiet || process.env.QDONE_QUIET === 'true' || exports.defaults.quiet,
|
|
95
|
+
verbose: options.verbose || process.env.QDONE_VERBOSE === 'true' || exports.defaults.verbose,
|
|
96
|
+
fifo: options.fifo || process.env.QDONE_FIFO === 'true' || exports.defaults.fifo,
|
|
97
|
+
sentryDsn: options.sentryDsn || options['sentry-dsn'] || process.env.QDONE_SENTRY_DSN,
|
|
98
|
+
disableLog: options.disableLog || options['disable-log'] || process.env.QDONE_DISABLE_LOG === 'true' || exports.defaults.disableLog,
|
|
99
|
+
includeFailed: options.includeFailed || options['include-failed'] || process.env.QDONE_INCLUDE_FAILED === 'true' || exports.defaults.includeFailed,
|
|
100
|
+
includeDead: options.includeDead || options['include-dead'] || process.env.QDONE_INCLUDE_DEAD === 'true' || exports.defaults.includeDead,
|
|
101
|
+
externalDedup: options.externalDedup || options['external-dedup'] || process.env.QDONE_EXTERNAL_DEDUP === 'true' || exports.defaults.externalDedup,
|
|
102
|
+
dedupPeriod: options.dedupPeriod || options['dedup-period'] || process.env.QDONE_DEDUP_PERIOD || exports.defaults.dedupPeriod,
|
|
103
|
+
dedupStats: options.dedupStats || options['dedup-stats'] || process.env.QDONE_DEDUP_STATS === 'true' || exports.defaults.dedupStats,
|
|
103
104
|
// Cache
|
|
104
|
-
cacheUri: options.cacheUri || options['cache-uri'] || exports.defaults.cacheUri,
|
|
105
|
-
cachePrefix: options.cachePrefix || options['cache-prefix'] || exports.defaults.cachePrefix,
|
|
106
|
-
cacheTtlSeconds: options.cacheTtlSeconds || options['cache-ttl-seconds'] || exports.defaults.cacheTtlSeconds,
|
|
105
|
+
cacheUri: options.cacheUri || options['cache-uri'] || process.env.QDONE_CACHE_URI || exports.defaults.cacheUri,
|
|
106
|
+
cachePrefix: options.cachePrefix || options['cache-prefix'] || process.env.QDONE_CACHE_PREFIX || exports.defaults.cachePrefix,
|
|
107
|
+
cacheTtlSeconds: options.cacheTtlSeconds || options['cache-ttl-seconds'] || process.env.QDONE_CACHE_TTL_SECONDS || exports.defaults.cacheTtlSeconds,
|
|
107
108
|
// Enqueue
|
|
108
|
-
groupId: options.groupId || options['group-id'] || exports.defaults.groupId,
|
|
109
|
+
groupId: options.groupId || options['group-id'] || process.env.QDONE_GROUP_ID || exports.defaults.groupId,
|
|
109
110
|
groupIdPerMessage: false,
|
|
110
|
-
deduplicationId: options.deduplicationId || options['deduplication-id'] || exports.defaults.deduplicationId,
|
|
111
|
-
dedupIdPerMessage: options.dedupIdPerMessage || options['dedup-id-per-message'] || exports.defaults.dedupIdPerMessage,
|
|
112
|
-
messageRetentionPeriod: options.messageRetentionPeriod || options['message-retention-period'] || exports.defaults.messageRetentionPeriod,
|
|
113
|
-
delay: options.delay || exports.defaults.delay,
|
|
114
|
-
sendRetries: options['send-retries'] || exports.defaults.sendRetries,
|
|
115
|
-
failDelay: options.failDelay || options['fail-delay'] || exports.defaults.failDelay,
|
|
111
|
+
deduplicationId: options.deduplicationId || options['deduplication-id'] || process.env.QDONE_DEDUPLICATION_ID || exports.defaults.deduplicationId,
|
|
112
|
+
dedupIdPerMessage: options.dedupIdPerMessage || options['dedup-id-per-message'] || process.env.QDONE_DEDUP_ID_PER_MESSAGE === 'true' || exports.defaults.dedupIdPerMessage,
|
|
113
|
+
messageRetentionPeriod: options.messageRetentionPeriod || options['message-retention-period'] || process.env.QDONE_MESSAGE_RETENTION_PERIOD || exports.defaults.messageRetentionPeriod,
|
|
114
|
+
delay: options.delay || process.env.QDONE_DELAY || exports.defaults.delay,
|
|
115
|
+
sendRetries: options.sendRetries || options['send-retries'] || process.env.QDONE_SEND_RETRIES || exports.defaults.sendRetries,
|
|
116
|
+
failDelay: options.failDelay || options['fail-delay'] || process.env.QDONE_FAIL_DELAY || exports.defaults.failDelay,
|
|
116
117
|
dlq: dlq === false ? false : exports.defaults.dlq,
|
|
117
|
-
dlqSuffix: options.dlqSuffix || options['dlq-suffix'] || exports.defaults.dlqSuffix,
|
|
118
|
-
dlqAfter: options.dlqAfter || options['dlq-after'] || exports.defaults.dlqAfter,
|
|
118
|
+
dlqSuffix: options.dlqSuffix || options['dlq-suffix'] || process.env.QDONE_DLQ_SUFFIX || exports.defaults.dlqSuffix,
|
|
119
|
+
dlqAfter: options.dlqAfter || options['dlq-after'] || process.env.QDONE_DLQ_AFTER || exports.defaults.dlqAfter,
|
|
119
120
|
tags: options.tags || undefined,
|
|
120
121
|
// Worker
|
|
121
|
-
waitTime: options.waitTime || options['wait-time'] || exports.defaults.waitTime,
|
|
122
|
-
killAfter: options.killAfter || options['kill-after'] || exports.defaults.killAfter,
|
|
123
|
-
archive: options.archive || exports.defaults.archive,
|
|
124
|
-
activeOnly: options.activeOnly || options['active-only'] || exports.defaults.activeOnly,
|
|
125
|
-
maxConcurrentJobs: options.maxConcurrentJobs || exports.defaults.maxConcurrentJobs,
|
|
126
|
-
maxMemoryPercent: options.maxMemoryPercent || exports.defaults.maxMemoryPercent,
|
|
122
|
+
waitTime: options.waitTime || options['wait-time'] || process.env.QDONE_WAIT_TIME || exports.defaults.waitTime,
|
|
123
|
+
killAfter: options.killAfter || options['kill-after'] || process.env.QDONE_KILL_AFTER || exports.defaults.killAfter,
|
|
124
|
+
archive: options.archive || process.env.QDONE_ARCHIVE === 'true' || exports.defaults.archive,
|
|
125
|
+
activeOnly: options.activeOnly || options['active-only'] || process.env.QDONE_ACTIVE_ONLY === 'true' || exports.defaults.activeOnly,
|
|
126
|
+
maxConcurrentJobs: options.maxConcurrentJobs || process.env.QDONE_MAX_CONCURRENT_JOBS || exports.defaults.maxConcurrentJobs,
|
|
127
|
+
maxMemoryPercent: options.maxMemoryPercent || process.env.QDONE_MAX_MEMORY_PERCENT || exports.defaults.maxMemoryPercent,
|
|
127
128
|
// Idle Queues
|
|
128
|
-
idleFor: options.idleFor || options['idle-for'] || exports.defaults.idleFor,
|
|
129
|
-
delete: options.delete || exports.defaults.delete,
|
|
130
|
-
unpair: options.unpair || exports.defaults.unpair,
|
|
129
|
+
idleFor: options.idleFor || options['idle-for'] || process.env.QDONE_IDLE_FOR || exports.defaults.idleFor,
|
|
130
|
+
delete: options.delete || process.env.QDONE_DELETE === 'true' || exports.defaults.delete,
|
|
131
|
+
unpair: options.unpair || process.env.QDONE_UNPAIR === 'true' || exports.defaults.unpair,
|
|
131
132
|
// Check
|
|
132
|
-
create: options.create || exports.defaults.create,
|
|
133
|
-
overwrite: options.overwrite || exports.defaults.overwrite
|
|
133
|
+
create: options.create || process.env.QDONE_CREATE === 'true' || exports.defaults.create,
|
|
134
|
+
overwrite: options.overwrite || process.env.QDONE_OVERWRITE === 'true' || exports.defaults.overwrite
|
|
134
135
|
};
|
|
135
136
|
// Setting this env here means we don't have to in AWS SDK constructors
|
|
136
137
|
process.env.AWS_REGION = opt.region;
|
package/commonjs/src/monitor.js
CHANGED
|
@@ -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)('
|
|
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
|
|
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)
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "qdone",
|
|
3
|
-
"version": "2.0.
|
|
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.
|
|
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
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 {
|
|
238
|
-
|
|
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/defaults.js
CHANGED
|
@@ -50,7 +50,8 @@ export const defaults = Object.freeze({
|
|
|
50
50
|
unpair: false,
|
|
51
51
|
|
|
52
52
|
// Check
|
|
53
|
-
create: false
|
|
53
|
+
create: false,
|
|
54
|
+
overwrite: false
|
|
54
55
|
})
|
|
55
56
|
|
|
56
57
|
export function validateInteger (opt, name) {
|
|
@@ -89,55 +90,55 @@ export function getOptionsWithDefaults (options) {
|
|
|
89
90
|
|
|
90
91
|
const opt = {
|
|
91
92
|
// Shared
|
|
92
|
-
prefix: options.prefix === '' ? options.prefix : (options.prefix || defaults.prefix),
|
|
93
|
-
failSuffix: options.failSuffix || options['fail-suffix'] || defaults.failSuffix,
|
|
94
|
-
region: options.region || process.env.AWS_REGION || defaults.region,
|
|
95
|
-
quiet: options.quiet || defaults.quiet,
|
|
96
|
-
verbose: options.verbose || defaults.verbose,
|
|
97
|
-
fifo: options.fifo || defaults.fifo,
|
|
98
|
-
sentryDsn: options.sentryDsn || options['sentry-dsn'],
|
|
99
|
-
disableLog: options.disableLog || options['disable-log'] || defaults.disableLog,
|
|
100
|
-
includeFailed: options.includeFailed || options['include-failed'] || defaults.includeFailed,
|
|
101
|
-
includeDead: options.includeDead || options['include-dead'] || defaults.includeDead,
|
|
102
|
-
externalDedup: options.externalDedup || options['external-dedup'] || defaults.externalDedup,
|
|
103
|
-
dedupPeriod: options.dedupPeriod || options['dedup-period'] || defaults.dedupPeriod,
|
|
104
|
-
dedupStats: options.dedupStats || options['dedup-stats'] || defaults.dedupStats,
|
|
93
|
+
prefix: options.prefix === '' ? options.prefix : (options.prefix || process.env.QDONE_PREFIX || defaults.prefix),
|
|
94
|
+
failSuffix: options.failSuffix || options['fail-suffix'] || process.env.QDONE_FAIL_SUFFIX || defaults.failSuffix,
|
|
95
|
+
region: options.region || process.env.QDONE_REGION || process.env.AWS_REGION || defaults.region,
|
|
96
|
+
quiet: options.quiet || process.env.QDONE_QUIET === 'true' || defaults.quiet,
|
|
97
|
+
verbose: options.verbose || process.env.QDONE_VERBOSE === 'true' || defaults.verbose,
|
|
98
|
+
fifo: options.fifo || process.env.QDONE_FIFO === 'true' || defaults.fifo,
|
|
99
|
+
sentryDsn: options.sentryDsn || options['sentry-dsn'] || process.env.QDONE_SENTRY_DSN,
|
|
100
|
+
disableLog: options.disableLog || options['disable-log'] || process.env.QDONE_DISABLE_LOG === 'true' || defaults.disableLog,
|
|
101
|
+
includeFailed: options.includeFailed || options['include-failed'] || process.env.QDONE_INCLUDE_FAILED === 'true' || defaults.includeFailed,
|
|
102
|
+
includeDead: options.includeDead || options['include-dead'] || process.env.QDONE_INCLUDE_DEAD === 'true' || defaults.includeDead,
|
|
103
|
+
externalDedup: options.externalDedup || options['external-dedup'] || process.env.QDONE_EXTERNAL_DEDUP === 'true' || defaults.externalDedup,
|
|
104
|
+
dedupPeriod: options.dedupPeriod || options['dedup-period'] || process.env.QDONE_DEDUP_PERIOD || defaults.dedupPeriod,
|
|
105
|
+
dedupStats: options.dedupStats || options['dedup-stats'] || process.env.QDONE_DEDUP_STATS === 'true' || defaults.dedupStats,
|
|
105
106
|
|
|
106
107
|
// Cache
|
|
107
|
-
cacheUri: options.cacheUri || options['cache-uri'] || defaults.cacheUri,
|
|
108
|
-
cachePrefix: options.cachePrefix || options['cache-prefix'] || defaults.cachePrefix,
|
|
109
|
-
cacheTtlSeconds: options.cacheTtlSeconds || options['cache-ttl-seconds'] || defaults.cacheTtlSeconds,
|
|
108
|
+
cacheUri: options.cacheUri || options['cache-uri'] || process.env.QDONE_CACHE_URI || defaults.cacheUri,
|
|
109
|
+
cachePrefix: options.cachePrefix || options['cache-prefix'] || process.env.QDONE_CACHE_PREFIX || defaults.cachePrefix,
|
|
110
|
+
cacheTtlSeconds: options.cacheTtlSeconds || options['cache-ttl-seconds'] || process.env.QDONE_CACHE_TTL_SECONDS || defaults.cacheTtlSeconds,
|
|
110
111
|
|
|
111
112
|
// Enqueue
|
|
112
|
-
groupId: options.groupId || options['group-id'] || defaults.groupId,
|
|
113
|
+
groupId: options.groupId || options['group-id'] || process.env.QDONE_GROUP_ID || defaults.groupId,
|
|
113
114
|
groupIdPerMessage: false,
|
|
114
|
-
deduplicationId: options.deduplicationId || options['deduplication-id'] || defaults.deduplicationId,
|
|
115
|
-
dedupIdPerMessage: options.dedupIdPerMessage || options['dedup-id-per-message'] || defaults.dedupIdPerMessage,
|
|
116
|
-
messageRetentionPeriod: options.messageRetentionPeriod || options['message-retention-period'] || defaults.messageRetentionPeriod,
|
|
117
|
-
delay: options.delay || defaults.delay,
|
|
118
|
-
sendRetries: options['send-retries'] || defaults.sendRetries,
|
|
119
|
-
failDelay: options.failDelay || options['fail-delay'] || defaults.failDelay,
|
|
115
|
+
deduplicationId: options.deduplicationId || options['deduplication-id'] || process.env.QDONE_DEDUPLICATION_ID || defaults.deduplicationId,
|
|
116
|
+
dedupIdPerMessage: options.dedupIdPerMessage || options['dedup-id-per-message'] || process.env.QDONE_DEDUP_ID_PER_MESSAGE === 'true' || defaults.dedupIdPerMessage,
|
|
117
|
+
messageRetentionPeriod: options.messageRetentionPeriod || options['message-retention-period'] || process.env.QDONE_MESSAGE_RETENTION_PERIOD || defaults.messageRetentionPeriod,
|
|
118
|
+
delay: options.delay || process.env.QDONE_DELAY || defaults.delay,
|
|
119
|
+
sendRetries: options.sendRetries || options['send-retries'] || process.env.QDONE_SEND_RETRIES || defaults.sendRetries,
|
|
120
|
+
failDelay: options.failDelay || options['fail-delay'] || process.env.QDONE_FAIL_DELAY || defaults.failDelay,
|
|
120
121
|
dlq: dlq === false ? false : defaults.dlq,
|
|
121
|
-
dlqSuffix: options.dlqSuffix || options['dlq-suffix'] || defaults.dlqSuffix,
|
|
122
|
-
dlqAfter: options.dlqAfter || options['dlq-after'] || defaults.dlqAfter,
|
|
122
|
+
dlqSuffix: options.dlqSuffix || options['dlq-suffix'] || process.env.QDONE_DLQ_SUFFIX || defaults.dlqSuffix,
|
|
123
|
+
dlqAfter: options.dlqAfter || options['dlq-after'] || process.env.QDONE_DLQ_AFTER || defaults.dlqAfter,
|
|
123
124
|
tags: options.tags || undefined,
|
|
124
125
|
|
|
125
126
|
// Worker
|
|
126
|
-
waitTime: options.waitTime || options['wait-time'] || defaults.waitTime,
|
|
127
|
-
killAfter: options.killAfter || options['kill-after'] || defaults.killAfter,
|
|
128
|
-
archive: options.archive || defaults.archive,
|
|
129
|
-
activeOnly: options.activeOnly || options['active-only'] || defaults.activeOnly,
|
|
130
|
-
maxConcurrentJobs: options.maxConcurrentJobs || defaults.maxConcurrentJobs,
|
|
131
|
-
maxMemoryPercent: options.maxMemoryPercent || defaults.maxMemoryPercent,
|
|
127
|
+
waitTime: options.waitTime || options['wait-time'] || process.env.QDONE_WAIT_TIME || defaults.waitTime,
|
|
128
|
+
killAfter: options.killAfter || options['kill-after'] || process.env.QDONE_KILL_AFTER || defaults.killAfter,
|
|
129
|
+
archive: options.archive || process.env.QDONE_ARCHIVE === 'true' || defaults.archive,
|
|
130
|
+
activeOnly: options.activeOnly || options['active-only'] || process.env.QDONE_ACTIVE_ONLY === 'true' || defaults.activeOnly,
|
|
131
|
+
maxConcurrentJobs: options.maxConcurrentJobs || process.env.QDONE_MAX_CONCURRENT_JOBS || defaults.maxConcurrentJobs,
|
|
132
|
+
maxMemoryPercent: options.maxMemoryPercent || process.env.QDONE_MAX_MEMORY_PERCENT || defaults.maxMemoryPercent,
|
|
132
133
|
|
|
133
134
|
// Idle Queues
|
|
134
|
-
idleFor: options.idleFor || options['idle-for'] || defaults.idleFor,
|
|
135
|
-
delete: options.delete || defaults.delete,
|
|
136
|
-
unpair: options.unpair || defaults.unpair,
|
|
135
|
+
idleFor: options.idleFor || options['idle-for'] || process.env.QDONE_IDLE_FOR || defaults.idleFor,
|
|
136
|
+
delete: options.delete || process.env.QDONE_DELETE === 'true' || defaults.delete,
|
|
137
|
+
unpair: options.unpair || process.env.QDONE_UNPAIR === 'true' || defaults.unpair,
|
|
137
138
|
|
|
138
139
|
// Check
|
|
139
|
-
create: options.create || defaults.create,
|
|
140
|
-
overwrite: options.overwrite || defaults.overwrite
|
|
140
|
+
create: options.create || process.env.QDONE_CREATE === 'true' || defaults.create,
|
|
141
|
+
overwrite: options.overwrite || process.env.QDONE_OVERWRITE === 'true' || defaults.overwrite
|
|
141
142
|
}
|
|
142
143
|
|
|
143
144
|
// Setting this env here means we don't have to in AWS SDK constructors
|
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('
|
|
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
|
|
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...')
|