Stats   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 45
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A untrack() 0 3 1
A __construct() 0 3 1
A sPending() 0 3 1
A cBusying() 0 3 1
A cIdling() 0 3 1
1
<?php
2
/**
3
 * Stats exporter
4
 * User: moyo
5
 * Date: 2018/5/19
6
 * Time: 10:19 PM
7
 */
8
9
namespace Carno\Pool;
10
11
class Stats
12
{
13
    /**
14
     * @var Connections
15
     */
16
    private $c = null;
17
18
    /**
19
     * Stats constructor.
20
     * @param Connections $c
21
     */
22
    public function __construct(Connections $c)
23
    {
24
        $this->c = $c;
25
    }
26
27
    /**
28
     */
29
    public function untrack() : void
30
    {
31
        $this->c = null;
32
    }
33
34
    /**
35
     * @return int
36
     */
37
    public function cIdling() : int
38
    {
39
        return $this->c->cIdleCount();
40
    }
41
42
    /**
43
     * @return int
44
     */
45
    public function cBusying() : int
46
    {
47
        return $this->c->cBusyCount();
48
    }
49
50
    /**
51
     * @return int
52
     */
53
    public function sPending() : int
54
    {
55
        return $this->c->cWaitCount();
56
    }
57
}
58