# Path: tapes/distributed/proxy.py
# class MetricsProxy(object):
#     def __init__(self, socket):
#         self.socket = socket
# 
#     def send(self, message):
#         distributed_logger.debug('Sending message %s', message)
#         self.socket.send_pyobj(message)
# 
# Path: tapes/distributed/message.py



import contextlib
from time import time
from .proxy import MetricsProxy
from .message import Message



class TimerProxy(MetricsProxy):
    def __init__(self, socket, name):
        super(TimerProxy, self).__init__(socket)
        self.name = name

    @contextlib.contextmanager
    def time(self):
        start_time = time()
        try:
            yield

# Path: tapes/distributed/proxy.py
# class MetricsProxy(object):
#     def __init__(self, socket):
#         self.socket = socket
# 
#     def send(self, message):
#         distributed_logger.debug('Sending message %s', message)
#         self.socket.send_pyobj(message)
# 
# Path: tapes/distributed/message.py



# Path: tapes/distributed/timer.py
import contextlib
from time import time
from .proxy import MetricsProxy
from .message import Message




class TimerProxy(MetricsProxy):
    def __init__(self, socket, name):
        super(TimerProxy, self).__init__(socket)
        self.name = name

    @contextlib.contextmanager
    def time(self):
        start_time = time()
        try:
            yield

        finally: