How to use the @tracerbench/core.analyze 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
// run the liveTrace
    const { traceEvents } = await liveTrace(
      url,
      tbResultsFolder,
      cookiesJSON,
      conditions
    );

    const analyzeOptions: IAnalyze = {
      traceEvents,
      traceHARJSON,
      methods,
    };

    // analyze the liveTrace
    await analyze(analyzeOptions);

    if (insights) {
      // js-eval-time
      let trace: any;
      let totalJSDuration: number = 0;
      let totalCSSDuration: number = 0;

      const methods = new Set();

      try {
        trace = setTraceEvents(traceEvents);
      } catch (error) {
        this.error(`${error}`);
      }

      trace