Completed
Push — master ( 9dca89...cdca22 )
by Frédéric G.
01:10
created

TimeoutsPlugin::config()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16

Duplication

Lines 16
Ratio 100 %

Importance

Changes 0
Metric Value
dl 16
loc 16
rs 9.7333
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/**
4
 * @file
5
 * Munin plugin for Beanstalkd timeouts monitoring
6
 *
7
 * @author: Frédéric G. MARAND <[email protected]>
8
 * @copyright (c) 2014-2018 Ouest Systèmes Informatiques (OSInet)
9
 * @license Apache License 2.0 or later
10
 */
11
12
namespace OSInet\Beanstalkd\Munin;
13
14 View Code Duplication
class TimeoutsPlugin extends BasePlugin
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
15
{
16
    /**
17
     * {@inheritdoc}
18
     */
19
    public function config()
20
    {
21
        $ret = <<<'EOT'
22
graph_title Job Timeouts
23
graph_vlabel Timeouts per ${graph_period}
24
graph_category Beanstalk
25
graph_args --lower-limit 0
26
graph_scale no
27
timeouts.label Timeouts
28
timeouts.type DERIVE
29
timeouts.min 0
30
31
EOT;
32
33
        return $ret;
34
    }
35
36
    /**
37
     * {@inheritdoc}
38
     */
39
    public function data()
40
    {
41
        $stats = $this->server->stats();
42
        $ret = sprintf("timeouts.value %d\n", $stats['job-timeouts']);
43
        return $ret;
44
    }
45
}
46