Code Duplication    Length = 13-13 lines in 2 locations

glances/exports/export.py 1 location

@@ 62-74 (lines=13) @@
59
        if self.config is not None:
60
            self.load_common_conf()
61
62
    def _log_result_decorator(fct):
63
        """Log (DEBUG) the result of the function fct."""
64
65
        def wrapper(*args, **kw):
66
            counter = Counter()
67
            ret = fct(*args, **kw)
68
            duration = counter.get()
69
            class_name = args[0].__class__.__name__
70
            class_module = args[0].__class__.__module__
71
            logger.debug(f"{class_name} {class_module} {fct.__name__} return {ret} in {duration} seconds")
72
            return ret
73
74
        return wrapper
75
76
    def exit(self):
77
        """Close the export module."""

glances/plugins/plugin/model.py 1 location

@@ 1143-1155 (lines=13) @@
1140
1141
        return wrapper
1142
1143
    def _log_result_decorator(fct):
1144
        """Log (DEBUG) the result of the function fct."""
1145
1146
        def wrapper(*args, **kw):
1147
            counter = Counter()
1148
            ret = fct(*args, **kw)
1149
            duration = counter.get()
1150
            class_name = args[0].__class__.__name__
1151
            class_module = args[0].__class__.__module__
1152
            logger.debug(f"{class_name} {class_module} {fct.__name__} return {ret} in {duration} seconds")
1153
            return ret
1154
1155
        return wrapper
1156
1157
    def _manage_rate(fct):
1158
        """Manage rate decorator for update method."""