예제 #1
0
        /// <summary>Run a Lighthouse performance audit and set the report and perf metrics in the database.
        /// <para>Does not run reports in parallel</para>
        /// </summary>
        public async Task runLightHouseAndSetReport(Url url)
        {
            dynamic lhr = await runLightHouse(_nodeServices, url.Name);

            Report report = createReport(lhr, url);
            IEnumerable <PerfMetric> perfMetrics = createPerfMetrics(lhr);
            int reportId = await LighthouseRepository.SetReport(_config, report);

            foreach (PerfMetric perfMetric in perfMetrics)
            {
                await LighthouseRepository.SetPerfMetric(_config, reportId, perfMetric);
            }
        }