-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added scaffolds for metric and event track methods
Signed-off-by: Giuseppe Macri <[email protected]>
- Loading branch information
1 parent
4b31511
commit 7c379ef
Showing
3 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const trackEvent = () => { | ||
// implement | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { LogMetric } from './types/metric.ts'; | ||
|
||
export const trackMetric = (options: LogMetric) => { | ||
// TODO: implement | ||
console.log(options); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// TODO: review this one because we don't support all of them | ||
export enum MetricType { | ||
count = 'count', | ||
rate = 'rate', | ||
gauge = 'gauge', | ||
distribution = 'distribution', | ||
histogram = 'histogram', | ||
} | ||
|
||
export type LogMetric = { | ||
apiPath?: string; | ||
metricName: string; | ||
metricType: MetricType; | ||
pagePath?: string; | ||
tags?: Record<string, string | boolean>; | ||
value: number; | ||
}; |