Learn more  » Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

agriconnect / opbeat   python

Repository URL to install this package:

/ instrumentation / packages / zlib.py

from opbeat.instrumentation.packages.base import AbstractInstrumentedModule
from opbeat.traces import trace


class ZLibInstrumentation(AbstractInstrumentedModule):
    name = 'zlib'
    instrument_list = [
        ('zlib', 'compress'),
        ('zlib', 'decompress'),
    ]

    def call(self, module, method, wrapped, instance, args, kwargs):
        wrapped_name = module + "." + method
        with trace(wrapped_name, "compression.zlib"):
            return wrapped(*args, **kwargs)