TimeoutsPlugin   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
eloc 14
c 2
b 0
f 0
dl 0
loc 28
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A config() 0 3 1
A data() 0 4 1
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-2020 Ouest Systèmes Informatiques (OSInet)
9
 * @license Apache License 2.0 or later
10
 */
11
12
declare(strict_types=1);
13
14
namespace OSInet\Beanstalkd\Munin;
15
16
class TimeoutsPlugin extends BasePlugin
17
{
18
19
    /**
20
     * {@inheritdoc}
21
     */
22
    public function config(): string
23
    {
24
        return <<<'CONFIG'
25
graph_title Job Timeouts
26
graph_vlabel Timeouts per ${graph_period}
27
graph_category Beanstalk
28
graph_args --lower-limit 0
29
graph_scale no
30
timeouts.label Timeouts
31
timeouts.type DERIVE
32
timeouts.min 0
33
34
CONFIG;
35
    }
36
37
    /**
38
     * {@inheritdoc}
39
     */
40
    public function data(): string
41
    {
42
        $stats = $this->server->stats();
43
        return sprintf("timeouts.value %d\n", $stats['job-timeouts']);
44
    }
45
}
46