/**
  * @param BenchmarkReportInterface $report
  *
  * @return string
  */
 private function createLogFromReport(BenchmarkReportInterface $report)
 {
     $logs = $this->getLogLine($report->getSiteToBenchmark());
     foreach ($report->getSitesToCompare() as $site) {
         $logs .= $this->getLogLine($site);
     }
     return $logs;
 }
 /**
  * Dispatch registered reporters if $report is Valid and ratio condition is met
  *
  * @param BenchmarkReportInterface $report
  */
 public function dispatch(BenchmarkReportInterface $report)
 {
     if (!$report->haveValidResults()) {
         return;
     }
     foreach ($this->reporters as $reporter) {
         if ($report->getFastestSiteToCompareRatio() > $reporter->getTriggerRatio()) {
             $reporter->sendReport($report);
         }
     }
 }
Example #3
0
 /**
  * Generates sms content
  */
 private function generateBody()
 {
     $this->body = sprintf('Website %s is loaded slower than at least one of the competitors', $this->benchmark->getSiteToBenchmark());
 }