How to use the @tracerbench/core.liveTrace 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
locations,
      network,
      harpath,
    } = flags;

    const methods = [''];
    const cookiesJSON = await readJson(path.resolve(cookiespath));
    const traceHAR = path.resolve(harpath);
    const traceHARJSON = await readJson(traceHAR);
    const conditions: IConditions = {
      cpu: cpuThrottleRate,
      network,
    };

    // 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) {