Conditions | 1 |
Paths | 1 |
Total Lines | 17 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
27 | public function __construct(Pool $pool) |
||
28 | { |
||
29 | $labels = [ |
||
30 | 'resource' => $pool->resource(), |
||
31 | 'pid' => spl_object_hash($pool), |
||
32 | ]; |
||
33 | |||
34 | $this->tick = Ticker::new( |
||
35 | [ |
||
36 | Metrics::gauge()->named('pool.conn.idle')->labels($labels), |
||
37 | Metrics::gauge()->named('pool.conn.busy')->labels($labels), |
||
38 | Metrics::gauge()->named('pool.select.wait')->labels($labels), |
||
39 | ], |
||
40 | static function (Gauge $idle, Gauge $busy, Gauge $wait) use ($pool) { |
||
41 | $idle->set($pool->stats()->cIdling()); |
||
42 | $busy->set($pool->stats()->cBusying()); |
||
43 | $wait->set($pool->stats()->sPending()); |
||
44 | } |
||
55 |