Home > @firebase/performance > PerformanceTrace > incrementMetric
PerformanceTrace.incrementMetric() method
Adds to the value of a custom metric. If a custom metric with the provided name does not exist, it creates one with that name and the value equal to the given number. The value will be floored down to an integer.
Signature:
incrementMetric(metricName: string, num?: number): void;
Parameters
Parameter | Type | Description |
---|---|---|
metricName | string | The name of the custom metric. |
num | number | The number to be added to the value of the custom metric. If not provided, it uses a default value of one. |
Returns:
void