( measureName: string, metric: any, attribution?: object, )
| 10 | import { getVitalsScore } from './vitalsScore'; |
| 11 | |
| 12 | export 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 |
no test coverage detected