Skip to content

Commit

Permalink
added scaffolds for metric and event track methods
Browse files Browse the repository at this point in the history
Signed-off-by: Giuseppe Macri <[email protected]>
  • Loading branch information
giuseppe-coinbase committed Oct 3, 2023
1 parent 4b31511 commit 7c379ef
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/trackEvent.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const trackEvent = () => {
// implement
};
6 changes: 6 additions & 0 deletions src/trackMetric.ts
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);
};
17 changes: 17 additions & 0 deletions src/types/metric.ts
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;
};

0 comments on commit 7c379ef

Please sign in to comment.