Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'#title': 'title',
'#value': 'value'
},
ExpressionAttributeValues: {
':title': title,
':value': value
},
ReturnValues: 'NONE'
}
await dynamoDocClient()
.update(params)
.promise()
const metrics = createMetricsLogger()
metrics.putMetric('EntryWords', title.trim().split(/s/).length, Unit.Count)
await metrics.flush()
return {
entId,
title,
value
}
}
title,
value
}
},
ReturnValues: 'ALL_NEW'
}
const {
Attributes: { entries }
} = await dynamoDocClient()
.update(params)
.promise()
const metrics = createMetricsLogger()
metrics.putMetric('NumEntries', Object.keys(entries).length, Unit.Count)
metrics.putMetric('EntryWords', title.trim().split(/s/).length, Unit.Count)
await metrics.flush()
return {
entId,
title,
value
}
}
'#entId': entId,
'#title': 'title',
'#value': 'value'
},
ExpressionAttributeValues: {
':title': title,
':value': value
},
ReturnValues: 'NONE'
}
await dynamoDocClient()
.update(params)
.promise()
const metrics = createMetricsLogger()
metrics.putMetric('EntryWords', title.trim().split(/s/).length, Unit.Count)
await metrics.flush()
return {
entId,
title,
value
}
}
ExpressionAttributeValues: {
':entry': {
title,
value
}
},
ReturnValues: 'ALL_NEW'
}
const {
Attributes: { entries }
} = await dynamoDocClient()
.update(params)
.promise()
const metrics = createMetricsLogger()
metrics.putMetric('NumEntries', Object.keys(entries).length, Unit.Count)
metrics.putMetric('EntryWords', title.trim().split(/s/).length, Unit.Count)
await metrics.flush()
return {
entId,
title,
value
}
}
const doWork = metricScope(metrics => async event => {
metrics.putDimensions({ Operation: 'Agent' });
metrics.putMetric('ExampleMetric', 100, Unit.Milliseconds);
metrics.setProperty('RequestId', '422b1569-16f6-4a03-b8f0-fe3fd9b100f8');
});
const { metricScope, Unit } = require('aws-embedded-metrics');
const doWork = metricScope(metrics => async event => {
metrics.putDimensions({ Operation: 'Agent' });
metrics.putMetric('ExampleMetric', 100, Unit.Milliseconds);
metrics.setProperty('RequestId', '422b1569-16f6-4a03-b8f0-fe3fd9b100f8');
});
doWork();