Code Duplication    Length = 13-13 lines in 2 locations

glances/plugins/plugin/model.py 1 location

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

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."""