| Total Complexity | 4 |
| Total Lines | 73 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | class Aggregator |
||
| 17 | { |
||
| 18 | /** |
||
| 19 | * @var array |
||
| 20 | */ |
||
| 21 | private $metrics = []; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @var Daemon |
||
| 25 | */ |
||
| 26 | private $source = null; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @var string |
||
| 30 | */ |
||
| 31 | private $timer = null; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @var int |
||
| 35 | */ |
||
| 36 | private $cycled = null; |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Aggregation constructor. |
||
| 40 | * @param Daemon $daemon |
||
| 41 | * @param int $cycled |
||
| 42 | */ |
||
| 43 | public function __construct(Daemon $daemon, int $cycled = 2) |
||
| 44 | { |
||
| 45 | $this->source = $daemon; |
||
| 46 | $this->cycled = $cycled; |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @return array |
||
| 51 | */ |
||
| 52 | public function metrics() : array |
||
| 53 | { |
||
| 54 | return $this->metrics; |
||
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * @return static |
||
| 59 | */ |
||
| 60 | public function start() : self |
||
| 80 | } |
||
| 81 | |||
| 82 | /** |
||
| 83 | * @return Promised |
||
| 84 | */ |
||
| 85 | public function stop() : Promised |
||
| 91 |