Skip to content

aluzzardi/zerorpc-statsd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

ZeroRPC StatsD Middleware

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages