Gauge::set_to_current_time()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 5
rs 9.4285
1
<?php
2
3
namespace Aptarus\PromClient;
4
5
class Gauge extends Metric
6
{
7
    public function __construct(
8
        $var,
9
        $help = "",
10
        $labels = null,
11
        $label_values = null
12
    ) {
13
    
14
        parent::__construct('gauge', $var, $help, $labels, $label_values);
15
    }
16
17
    public function inc($value = 1)
18
    {
19
        $this->metricInc($value);
20
    }
21
22
    public function dec($value = 1)
23
    {
24
        $this->metricInc(-$value);
25
    }
26
27
    public function set($value)
28
    {
29
        $this->metricSet($value);
30
    }
31
32
    // @codingStandardsIgnoreStart
33
    public function set_to_current_time()
34
    {
35
        // @codingStandardsIgnoreEnd
36
        $this->metricSet(time());
37
    }
38
}
39
40
// vim:sw=4 ts=4 et
41