public async Task <string> SetLighthouseReports() { IEnumerable <Url> urls = await LighthouseRepository.GetUrls(_config); foreach (Url url in urls) { await _LighthouseBLL.runLightHouseAndSetReport(url); } return("Lighthouse has been run for the Urls retrieved from the database"); }
/// <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); } }
public async Task <IEnumerable <Url> > GetUrls() { IEnumerable <Url> urls = await LighthouseRepository.GetUrls(_config); return(urls); }
public async Task <IEnumerable <PerfMetric> > GetPerfMetricsByReportId(int reportId) { var perfMetrics = await LighthouseRepository.GetPerfMetricsByReportId(_config, reportId); return(perfMetrics); }
public async Task <IEnumerable <Report> > GetReports(int id) { var reports = await LighthouseRepository.GetReportsByUrlId(_config, id); return(reports); }