public function __construct($minutes)
 {
     $data = static::getProblematicCountries($minutes * -1);
     $serie = Serie::create('app');
     $total = 0;
     $cnt = 0;
     $other = 0;
     $unknown = false;
     foreach ($data as $app => $count) {
         if ($app == 'unknown') {
             $unknown = true;
         }
         if ($cnt++ < 6) {
             $serie->addData($app, $count);
             $total += $count;
         } else {
             $other += $count;
             $total += $count;
         }
     }
     if ($other > 0) {
         $serie->addData('other', $other);
     }
     $minusUnknown = $unknown ? -1 : 0;
     $this->title('Total countries: ' . (sizeof($data) + $minusUnknown));
     $this->addSerie($serie);
 }
Ejemplo n.º 2
0
 public function __construct($minutes)
 {
     $data = \Crash\Submit::getProblematicBrandModels($minutes * -1);
     $serie = Serie::create('brand');
     $others = 0;
     $cnt = 0;
     foreach ($data as $brand => $count) {
         if ($cnt++ >= 6) {
             $others += $count;
         } else {
             $serie->addData($brand, $count);
         }
     }
     if ($others > 0) {
         $serie->addData('other', $others);
     }
     $this->title('Total brands: ' . sizeof($data));
     $this->addSerie($serie);
 }
 public function __construct($minutes)
 {
     $data = static::getRecords($minutes * -1);
     $serie = Serie::create('label');
     $total = 0;
     $cnt = 0;
     $other = 0;
     foreach ($data as $label => $count) {
         if ($cnt++ < 6) {
             $serie->addData($label, $count);
             $total += $count;
         } else {
             $other += $count;
             $total += $count;
         }
     }
     if ($other > 0) {
         $serie->addData('other', $other);
     }
     $this->title('Total items: ' . sizeof($data));
     $this->addSerie($serie);
 }
Ejemplo n.º 4
0
 public function __construct($minutes)
 {
     $data = \Crash\Submit::getProblematicApps($minutes * -1);
     $serie = Serie::create('app');
     $total = 0;
     $cnt = 0;
     $other = 0;
     foreach ($data as $app => $count) {
         if ($cnt++ < 6) {
             $serie->addData($app, $count);
             $total += $count;
         } else {
             $other += $count;
             $total += $count;
         }
     }
     if ($other > 0) {
         $serie->addData('other', $other);
     }
     $this->title('Total apps: ' . sizeof($data));
     $this->addSerie($serie);
 }