MCPcopy
hub / github.com/angular/angularfire / trace$

Function trace$

src/compat/performance/performance.ts:54–73  ·  view source on GitHub ↗
(traceId: string)

Source from the content-addressed store, hash-verified

52}
53
54const trace$ = (traceId: string) => {
55 // eslint-disable-next-line @typescript-eslint/prefer-optional-chain
56 if (typeof window !== 'undefined' && window.performance?.mark) {
57 const entries = window.performance.getEntriesByName(traceId, 'measure') || [];
58 const startMarkName = `_${traceId}Start[${entries.length}]`;
59 const endMarkName = `_${traceId}End[${entries.length}]`;
60 return new Observable<void>(emitter => {
61 window.performance.mark(startMarkName);
62 emitter.next();
63 return {
64 unsubscribe: () => {
65 window.performance.mark(endMarkName);
66 window.performance.measure(traceId, startMarkName, endMarkName);
67 }
68 };
69 });
70 } else {
71 return EMPTY;
72 }
73};
74
75export const traceUntil = <T = any>(
76 name: string,

Callers 5

traceUntilFunction · 0.85
traceWhileFunction · 0.85
traceUntilCompleteFunction · 0.85
traceUntilFirstFunction · 0.85
traceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected