Completed
Push — master ( 390e4e...b0ec12 )
by Taosikai
12:57
created

SummaryWatcher   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 0
cbo 3
dl 0
loc 22
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 8 1
A getInterval() 0 4 1
1
<?php
2
/**
3
 * Spike library
4
 * @author Tao <[email protected]>
5
 */
6
namespace Spike\Server\Timer;
7
8
class SummaryWatcher extends PeriodicTimer
9
{
10
    /**
11
     * {@inheritdoc}
12
     */
13
    public function __invoke()
14
    {
15
        $message = sprintf('Client Total: %s; Tunnel Server: %s',
16
            count($this->server->getClients()),
17
            count($this->server->getTunnelServers())
18
        );
19
        $this->server->getLogger()->info($message);
20
    }
21
22
    /**
23
     * {@inheritdoc}
24
     */
25
    public function getInterval()
26
    {
27
        return 30;
28
    }
29
}