Home > @firebase/performance > PerformanceTrace > record
PerformanceTrace.record() method
Records a trace from given parameters. This provides a direct way to use trace without a need to start/stop. This is useful for use cases in which the trace cannot directly be used (e.g. if the duration was captured before the Performance SDK was loaded).
Signature:
record(startTime: number, duration: number, options?: {
metrics?: {
[key: string]: number;
};
attributes?: {
[key: string]: string;
};
}): void;
Parameters
Parameter | Type | Description |
---|---|---|
startTime | number | trace start time since epoch in millisec. |
duration | number | The duraction of the trace in millisec. |
options | { metrics?: { [key: string]: number; }; attributes?: { [key: string]: string; }; } | An object which can optionally hold maps of custom metrics and custom attributes. |
Returns:
void