python import statsd client = statsd.StatsClient('localhost', 8125) client.incr('api.requests') with client.timer('api.response_time'): response = perform_expensive_operation() client.histogram('api.latency', latency)