Skip to content

yhino/py-grpc-profile

Repository files navigation

py-grpc-profile

Profile the grpc server.
Provide a grpc interceptor to profile each request in the cProfile module.

build PyPI - Downloads

Installation

$ pip install -U py-grpc-profile

Example

Load the module and set the interceptors.

from concurrent import futures

import grpc
from py_grpc_profile.server.interceptor import ProfileInterceptor

# ...

server = grpc.server(
    futures.ThreadPoolExecutor(max_workers=10),
    interceptors=[ProfileInterceptor()],
)

# ...

The complete code is available in example. You can find more details there.

License

License FOSSA Status

FOSSA Status