How to use the webcoach.merge function in webcoach

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

github sitespeedio / sitespeed.io / lib / plugins / browsertime / index.js View on Github external
{
                      url,
                      runIndex,
                      iteration: runIndex + 1
                    }
                  )
                );
              }

              let advice = coachAdvice;
              // If we run without HAR
              if (result.har) {
                // make sure to get the right run in the HAR
                const myHar = api.pickAPage(result.har, harIndex);
                const harResult = await api.runHarAdvice(myHar);
                advice = api.merge(coachAdvice, harResult);
              }
              queue.postMessage(
                make('coach.run', advice, {
                  url,
                  group,
                  runIndex,
                  iteration: runIndex + 1
                })
              );
            }

            aggregator.addToAggregate(run, group);
            runIndex++;
          }

          // Let take the first runs timestamp and use that as the summary timestamp
github thomasjbradley / markbot / app / checks / performance / task.js View on Github external
webcoach.runHarAdvice(webcoach.pickAPage(har, 0), webcoach.getHarAdvice()).then(function (harAdvice) {
        const coachResults = webcoach.merge(domAdvice, harAdvice);
        const coachAdvice = coachResults.advice;
        let errors = [];
        let messages = [];
        let budgetDetails = generateBudgetReport(perf, coachAdvice);

        if (doesPassPerfBudget(perf, coachAdvice)) {
          messages.push(budgetDetails);
        } else {
          errors.push(budgetDetails);
        }

        markbotMain.debug(`Performance score: ${coachAdvice.score}`);

        Object.keys(coachAdvice.performance.adviceList).forEach(function (id) {
          let advice = coachAdvice.performance.adviceList[id];
          let error = `**${advice.title}** — ${advice.advice}`;

webcoach

The coach gives you advice on building a better web page

MIT
Latest version published 10 months ago

Package Health Score

62 / 100
Full package analysis

Similar packages