How to use the @tracerbench/core.loadTrace function in @tracerbench/core

To help you get started, we’ve selected a few @tracerbench/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TracerBench / tracerbench / packages / cli / src / commands / trace.ts View on Github external
.filter((event: any) => event.args.data.styleSheetUrl)
        .forEach((event: any) => {
          const url = event.args.data.styleSheetUrl;
          const durationInMs = event.dur / 1000;
          totalCSSDuration += durationInMs;
          this.log(`CSS: ${url}: ${durationInMs.toFixed(2)}`);
        });

      // log css-parse-time
      this.log(
        `CSS: Evaluation Total Duration: ${totalCSSDuration.toFixed(2)}ms \n\n`
      );

      // list-functions
      try {
        const profile = loadTrace(trace).cpuProfile(-1, -1);
        if (locations) {
          profile.nodeMap.forEach((node: any) => {
            const {
              functionName,
              url,
              lineNumber,
              columnNumber,
            } = node.callFrame;

            methods.add(
              `${url}:${lineNumber}:${columnNumber}.${normalizeFnName(
                functionName
              )}`
            );
          });
        } else {