Code Duplication    Length = 15-16 lines in 2 locations

plumd/plugins/readers/linux/proc/stat.py 1 location

@@ 28-43 (lines=16) @@
25
        'per_cpu': False,
26
    }
27
28
    def __init__(self, log, config):
29
        """Plugin to measure various kernel metrics from /proc/stat
30
31
        :param log: A logger
32
        :type log: logging.RootLogger
33
        :param config: a plumd.config.Conf configuration helper instance.
34
        :type config: plumd.config.Conf
35
        """
36
        super(Stat, self).__init__(log, config)
37
        self.config.defaults(Stat.defaults)
38
        self.calc = Differential()
39
        self.proc_file = "{0}/stat".format(config.get('proc_path'))
40
        self.per_cpu = self.config.get('per_cpu')
41
        self.cpu_metrics = self.config.get('cpu_metrics')
42
        self.gauges = self.config.get('proc_stat_gauges')
43
        self.rates = self.config.get('proc_stat_rates')
44
45
46
    def poll(self):

plumd/plugins/readers/linux/proc/netsnmp.py 1 location

@@ 45-59 (lines=15) @@
42
        'proc_netsnmp_rates': {}
43
    }
44
45
    def __init__(self, log, config):
46
        """Plugin to measure various kernel metrics from /proc.
47
48
        :param log: A logger
49
        :type log: logging.RootLogger
50
        :param config: a plumd.config.Conf configuration helper instance.
51
        :type config: plumd.config.Conf
52
        """
53
        super(NetSnmp, self).__init__(log, config)
54
        self.config.defaults(NetSnmp.defaults)
55
        self.calc = Differential()
56
        self.proc_file = "{0}/net/snmp".format(config.get('proc_path'))
57
        self.filter = Filter()
58
        self.gauges = self.config.get('proc_netsnmp_gauges')
59
        self.rates = self.config.get('proc_netsnmp_rates')
60
61
62
    def poll(self):