From 58be1809c46cbe517a18d86d0af52179dcc5cbf6 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Sun, 29 Jun 2025 17:31:30 -0700 Subject: Move to nodejs and also lots of significant refactoring that should've been broken up but idgaf --- u/trace/metric/emittable.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 u/trace/metric/emittable.ts (limited to 'u/trace/metric/emittable.ts') diff --git a/u/trace/metric/emittable.ts b/u/trace/metric/emittable.ts new file mode 100644 index 0000000..f3441ec --- /dev/null +++ b/u/trace/metric/emittable.ts @@ -0,0 +1,18 @@ +import { IEmittableMetric, MetricValue, MetricValueTag, Unit } from './index.js'; + +export class EmittableMetric implements IEmittableMetric { + constructor( + public readonly name: string, + public readonly unit: Unit, + ) {} + + public withValue(value: number): MetricValue { + return { + name: this.name, + unit: this.unit, + emissionTimestamp: Date.now(), + value, + _tag: MetricValueTag, + }; + } +} -- cgit v1.2.3-70-g09d2