From 1626331e38d177310655e339d0db926ea83cacd6 Mon Sep 17 00:00:00 2001 From: Chainat Date: Fri, 27 Sep 2024 11:28:53 +1000 Subject: [PATCH] Dropped metric as we don't need to spplied --- samples/metricLogger1.sample.ts | 2 +- samples/metricLogger2.sample.ts | 2 +- src/MetricLogger/index.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/metricLogger1.sample.ts b/samples/metricLogger1.sample.ts index a4628c6..015b85f 100644 --- a/samples/metricLogger1.sample.ts +++ b/samples/metricLogger1.sample.ts @@ -19,7 +19,7 @@ const yourHandler = async () => { // 4) Send the metric to Mezmo, this will be logged as a JSON object // Should send once per execution to avoid duplicate metric - metricLogger.sendMetric(metric); + metricLogger.sendMetric(); }; // Example if you use Metric Logger in your handler diff --git a/samples/metricLogger2.sample.ts b/samples/metricLogger2.sample.ts index fb8e59d..9e98c74 100644 --- a/samples/metricLogger2.sample.ts +++ b/samples/metricLogger2.sample.ts @@ -19,7 +19,7 @@ const yourHandler = async () => { // 4) Send the metric to Mezmo, this will be logged as a JSON object // Should send once per execution to avoid duplicate metric - metricLogger.sendMetric(metric); + metricLogger.sendMetric(); }; // Example if you use Metric Logger in your handler diff --git a/src/MetricLogger/index.ts b/src/MetricLogger/index.ts index 630567a..67f4839 100644 --- a/src/MetricLogger/index.ts +++ b/src/MetricLogger/index.ts @@ -20,7 +20,7 @@ export class MetricLogger { * @param metric * @param stringifyMetric */ - sendMetric(metric: T, stringifyMetric = true): void { + sendMetric(metric: T = this._metric, stringifyMetric = true): void { if (!this._isTest) { const metricToSend = stringifyMetric ? JSON.stringify(metric) : metric; this._logger.info(metricToSend);