Esempio n. 1
0
 /**
  * @param DataCollectorInterface $collector
  * @return $this
  */
 public function addCollector(DataCollectorInterface $collector)
 {
     $this->collectors[$collector->getName()] = $collector;
     return $this;
 }
Esempio n. 2
0
 /**
  * @param DataCollectorInterface $collector
  */
 private function loadStats(DataCollectorInterface $collector)
 {
     $path = sprintf('%s/%s/%s', $this->path, $collector->getName(), $this->statsFilename);
     $stats = array();
     if (file_exists($path)) {
         $stats = json_decode(file_get_contents($path), true);
     }
     $collector->setStats($stats);
 }
Esempio n. 3
0
 /**
  * @param DataCollectorInterface $collector
  */
 private function loadStats(DataCollectorInterface $collector)
 {
     $data = $this->session->getBag($this->key)->get(sprintf('%s/%s', $collector->getName(), $this->statsName), array());
     $collector->setStats($data);
 }