Stats::untrack()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
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