Skip to content

Commit

Permalink
Add sendCountMetric to logger
Browse files Browse the repository at this point in the history
  • Loading branch information
elizabethmv committed Dec 19, 2023
1 parent df528dc commit 2bef2ad
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,25 @@ export const getLogger: GetLogger = memoize(() => {
url: loggerUrl,
});
});

export const sendCountMetricTest = ({
dimensions,
event = "unused",
name,
value = 1,
}: {|
event?: string,
name: string,
value?: number,
dimensions: {
[string]: mixed,
},
// $FlowIssue return type
|}) =>
getLogger().metric({

Check warning on line 37 in src/logger.js

View check run for this annotation

Codecov / codecov/patch

src/logger.js#L37

Added line #L37 was not covered by tests
dimensions,
metricEventName: event,
metricNamespace: name,
metricValue: value,
metricType: "counter",
});

0 comments on commit 2bef2ad

Please sign in to comment.