Code Duplication    Length = 13-13 lines in 2 locations

glances/exports/export.py 1 location

@@ 58-70 (lines=13) @@
55
        # Save last export list
56
        self._last_exported_list = None
57
58
    def _log_result_decorator(fct):
59
        """Log (DEBUG) the result of the function fct."""
60
61
        def wrapper(*args, **kw):
62
            counter = Counter()
63
            ret = fct(*args, **kw)
64
            duration = counter.get()
65
            class_name = args[0].__class__.__name__
66
            class_module = args[0].__class__.__module__
67
            logger.debug(f"{class_name} {class_module} {fct.__name__} return {ret} in {duration} seconds")
68
            return ret
69
70
        return wrapper
71
72
    def exit(self):
73
        """Close the export module."""

glances/plugins/plugin/model.py 1 location

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