statsdmetrics/client/__init__.py
def timing_since(self, name, start_time, rate=1):
        # type: (str, Union[float, datetime], float) -> None
        """Send a Timer metric calculating the duration from the start time"""
        duration = 0  # type: float
        if isinstance(start_time, datetime):
            duration = (datetime.now(start_time.tzinfo) - start_time).total_seconds() * 1000
        elif is_numeric(start_time):
            assert start_time > 0
            duration = (time() - start_time) * 1000
        else:
            raise ValueError("start time should be a timestamp or a datetime")
        self.timing(name, duration, rate)
def timing_since(self, name, start_time, rate=1):
        # type: (str, Union[float, datetime], float) -> None
        duration = 0  # type: float
        if isinstance(start_time, datetime):
            duration = (datetime.now(start_time.tzinfo) - start_time).total_seconds() * 1000
        elif is_numeric(start_time):
            assert start_time > 0
            duration = (time() - start_time) * 1000
        else:
            raise ValueError("start time should be a timestamp or a datetime")
        self.timing(name, duration, rate)
def timing_since ( self , name , start_time , rate = 1 ) : # type: (str, Union[float, datetime], float) -> None duration = 0 # type: float if isinstance ( start_time , datetime ) : duration = ( datetime . now ( start_time . tzinfo ) - start_time ) . total_seconds ( ) * 1000 elif is_numeric ( start_time ) : assert start_time > 0 duration = ( time ( ) - start_time ) * 1000 else : raise ValueError ( "start time should be a timestamp or a datetime" ) self . timing ( name , duration , rate )
Send a Timer metric calculating the duration from the start time
Send a Timer metric calculating the duration from the start time