ProgramStatus::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Program status (cpu memory and etc)
4
 * User: moyo
5
 * Date: 19/10/2017
6
 * Time: 4:39 PM
7
 */
8
9
namespace Carno\Monitor\Builtin;
10
11
use Carno\Monitor\Metrics;
12
use Carno\Monitor\Metrics\Gauge;
13
use Carno\Monitor\Ticker;
14
15
class ProgramStatus
16
{
17
    /**
18
     * ProgramStatus constructor.
19
     */
20
    public function __construct()
21
    {
22
        Ticker::new([Metrics::gauge()->named('memory.usage.bytes')], static function (Gauge $memory) {
23
            $memory->set(memory_get_usage());
24
        });
25
    }
26
}
27