ProgramStatus   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 9
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
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