'Generic decorator to wrap a function call with the
standard create-monitor -> start -> call -> stop idiom.'

@classmethod
def watch(cls, *monitor_args, **monitor_dargs):

    def decorator(func):
        def watched_func(*args, **dargs):
            monitor = cls(*monitor_args, **monitor_dargs)
            monitor.start()
            try:
                func(*args, **dargs)
            finally:
                monitor.stop()
        return watched_func
    return decorator
