@ovotech/castle
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -9,24 +9,21 @@ "use strict"; | ||
if (exports.isBatch(ctx)) { | ||
const offsetFirst = ctx.batch.firstOffset(); | ||
const offsetLast = ctx.batch.lastOffset(); | ||
const offsetLag = ctx.batch.offsetLag(); | ||
const messages = ctx.batch.messages.length; | ||
const partition = ctx.batch.partition; | ||
const topic = ctx.batch.topic; | ||
return [ | ||
`Consume ${ctx.batch.topic}`, | ||
{ | ||
topic: ctx.batch.topic, | ||
messages: ctx.batch.messages.length, | ||
partition: ctx.batch.partition, | ||
lag: ctx.batch.offsetLag(), | ||
offsetFirst: ctx.batch.firstOffset(), | ||
offsetLast: ctx.batch.lastOffset(), | ||
offsetLag: ctx.batch.offsetLag(), | ||
}, | ||
`Batch ${topic}[${partition}] msgs: ${messages}, offsets: ${offsetFirst}...${offsetLast}, lag: ${offsetLag}`, | ||
{ topic, messages, partition, offsetFirst, offsetLast, offsetLag }, | ||
]; | ||
} | ||
else if (exports.isMessage(ctx)) { | ||
const offset = ctx.message.offset; | ||
const key = ctx.message.key; | ||
const partition = ctx.partition; | ||
const topic = ctx.topic; | ||
return [ | ||
`Consume ${ctx.topic}`, | ||
{ | ||
topic: ctx.topic, | ||
offset: ctx.message.offset, | ||
key: ctx.message.key, | ||
partition: ctx.partition, | ||
}, | ||
`Message ${topic}[${partition}] offset: ${offset}, key: ${key}`, | ||
{ topic, offset, key, partition }, | ||
]; | ||
@@ -33,0 +30,0 @@ } |
{ | ||
"name": "@ovotech/castle", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"main": "dist/index.js", | ||
@@ -45,3 +45,3 @@ "types": "dist/index.d.ts", | ||
}, | ||
"gitHead": "1d43fe50bde26954e6ec94428422d183cd8ed173" | ||
"gitHead": "30ed3c31f8850d4d14269cf3a11c71f051630732" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20702
237