MCPcopy
hub / github.com/Zizzamia/perfume.js / logData

Function logData

src/log.ts:12–24  ·  view source on GitHub ↗
(
  measureName: string,
  metric: any,
  attribution?: object,
)

Source from the content-addressed store, hash-verified

10import { getVitalsScore } from './vitalsScore';
11
12export const logData = (
13 measureName: string,
14 metric: any,
15 attribution?: object,
16): void => {
17 Object.keys(metric).forEach(key => {
18 if (typeof metric[key] === 'number') {
19 metric[key] = roundByFour(metric[key]);
20 }
21 });
22 // Sends the metric to an external tracking service
23 reportPerf(measureName, metric, null, attribution || {});
24};
25
26/**
27 * Dispatches the metric duration into internal logs

Callers 5

initResourceTimingFunction · 0.90
reportStorageEstimateFunction · 0.90
initPerfumeFunction · 0.90
endFunction · 0.90
logMetricFunction · 0.85

Calls 2

roundByFourFunction · 0.90
reportPerfFunction · 0.90

Tested by

no test coverage detected