The Firebase JS SDK is now in BETA!
This EAP site is no longer maintained. See the official Firebase Documentation site for the latest documentation and information about the Firebase JS SDK.

Home > @firebase/performance > PerformanceTrace > putMetric

PerformanceTrace.putMetric() method

Sets the value of the specified custom metric to the given number regardless of whether a metric with that name already exists on the trace instance or not. The value will be floored down to an integer.

Signature:

putMetric(metricName: string, num: number): void;

Parameters

Parameter Type Description
metricName string Name of the custom metric.
num number Value to of the custom metric.

Returns:

void