MCPcopy Create free account
hub / github.com/angular/angular / finish

Method finish

packages/compiler-cli/preprocessor/src/perf.ts:347–378  ·  view source on GitHub ↗
(
    kind: SpanKind,
    start: number,
    now: number,
    fileId: number | undefined,
    childUs: number,
  )

Source from the content-addressed store, hash-verified

345 }
346
347 private finish(
348 kind: SpanKind,
349 start: number,
350 now: number,
351 fileId: number | undefined,
352 childUs: number,
353 ): void {
354 const dur = Math.max(0, now - start);
355 this.spanCount[kind]++;
356 this.spanInclusiveUs[kind] += dur;
357 this.spanSelfUs[kind] += Math.max(0, dur - childUs);
358 const depth = this.openChildUs.length;
359 if (depth > 0) {
360 this.openChildUs[depth - 1] += dur;
361 }
362 if (!AWAITING_KINDS[kind] && --this.openNonAwaiting === 0) {
363 this.busyUs += dur;
364 }
365 const event: TraceEvent = {
366 name: SPAN_NAMES[kind],
367 cat: 'ngp',
368 ph: 'X',
369 pid: this.pid,
370 tid: 1,
371 ts: start,
372 dur,
373 };
374 if (fileId) {
375 event.args = {f: fileId};
376 }
377 this.events.push(event);
378 }
379
380 slice<T>(kind: SpanKind, fn: () => T, fileId?: number): T {
381 const token = this.begin(kind, fileId);

Callers 2

recordMethod · 0.95
closeMethod · 0.95

Calls 2

maxMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected