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

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