Skip to content

Commit 9f9d1cf

Browse files
add oddOrEven from dimensions
1 parent c1a9bc2 commit 9f9d1cf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lambdas/upsert-letter/src/handler/upsert-handler.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ export default function createUpsertLetterHandler(deps: Deps): SQSHandler {
176176
metrics.putDimensions({
177177
FunctionName: "upsertLambda",
178178
OperationType: operation.name,
179+
// eslint-disable-next-line sonarjs/pseudo-random
180+
OddOrEven: `${Math.floor(Math.random() * 10) % 2}`,
179181
});
180182

181183
await runUpsert(operation, letterEvent, deps);
@@ -189,6 +191,8 @@ export default function createUpsertLetterHandler(deps: Deps): SQSHandler {
189191
);
190192
metrics.putDimensions({
191193
FunctionName: "upsertLambda",
194+
// eslint-disable-next-line sonarjs/pseudo-random
195+
OddOrEven: `${Math.floor(Math.random() * 10) % 2}`,
192196
});
193197
metrics.putMetric("MessageFailed", 1, Unit.Count);
194198
batchItemFailures.push({ itemIdentifier: record.messageId });

0 commit comments

Comments
 (0)