INNER CODE UNIT · JavaScript

usageForEvent

puppeteer/examples · code_coverage.js:189

    const usageForEvent = vals.filter(val => val.eventType === event);

    if (usageForEvent.length) {
      for (const stats of usageForEvent) {
        // totalBytes += stats.totalBytes;
        // totalUsedBytes += stats.usedBytes;

        const formatter = new UsageFormatter(stats);
        table.push([
          UsageFormatter.eventLabel(stats.eventType),
          formatter.barGraph(),
          formatter.shortSummary(stats.jsUsed), // !== 0 ? `${formatBytesToKB(stats.jsUsed)}KB` : 0,
          formatter.shortSummary(stats.cssUsed),
          formatter.summary()
        ]);
      }
    } else {
      table.push([UsageFormatter.eventLabel(event), 'no usage found', '-', '-', '-']);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…