Skip to content

Commit

Permalink
refactor(metrics): update usage examples to follow new naming convent…
Browse files Browse the repository at this point in the history
…ion of throwOnEmptyMetrics property
  • Loading branch information
kozub committed Jan 6, 2022
1 parent 11d7e29 commit bc77747
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/cdk/lib/example-function.MyFunction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const handler = async (_event: unknown, context: Context): Promise<void>

// ### Experiment metrics
metrics.captureColdStartMetric();
metrics.raiseOnEmptyMetrics();
metrics.throwOnEmptyMetrics();
metrics.setDefaultDimensions({ environment: 'example', type: 'standardFunction' });
metrics.addMetric('test-metric', MetricUnits.Count, 10);

Expand All @@ -38,7 +38,7 @@ export const handler = async (_event: unknown, context: Context): Promise<void>
metricWithItsOwnDimensions.addMetric('single-metric', MetricUnits.Percent, 50);

metrics.purgeStoredMetrics();
metrics.raiseOnEmptyMetrics();
metrics.throwOnEmptyMetrics();

// ### Experiment tracer

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class MyFunctionWithDecorator {
@logger.injectLambdaContext()
@metrics.logMetrics({
captureColdStartMetric: true,
raiseOnEmptyMetrics: true,
throwOnEmptyMetrics: true,
defaultDimensions: { environment: 'example', type: 'withDecorator' },
})
public handler(_event: unknown, _context: Context, _callback: Callback<unknown>): void | Promise<unknown> {
Expand Down

0 comments on commit bc77747

Please sign in to comment.