Code Duplication    Length = 13-13 lines in 2 locations

glances/plugins/plugin/model.py 1 location

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

glances/exports/export.py 1 location

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