ZeroRPC StatsD Middleware
Python
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
zerorpc_statsd
.gitignore
README.md
setup.py

README.md

StatsD Middleware for ZeroRPC

A StatsD middleware to track requests and response times of ZeroRPC Services

Usage

import zerorpc
import statsd
from zerorpc_statsd import StatsdMiddleware

# Create a statsd client
client = statsd.StatsClient()

# Register the middleware
zerorpc.Context.get_instance().register_middleware(StatsdMiddleware(client))

# Create a server as usual, it will be automatically tracked by the middleware
class Service(object):
    def do_something(self):
        pass

server = zerorpc.Server(Service())
server.bind('tcp://*:1234')
server.run()

Compatibility

  • ZeroRPC-Python < 0.4.0 is compatible with zerorpc-statsd < 0.2.0;
  • ZeroRPC-Python >= 0.4.0 requires zerorpc_statsd > 0.2.0.