Created
May 4, 2012 00:26
-
-
Save dkuebric/2590667 to your computer and use it in GitHub Desktop.
python worker tracing example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import oboe | |
from oboeware import loader | |
# load monkey-patched instrumentation for supported modules | |
loader.load_inst_modules() | |
# trace every unit of work done by decorated method | |
# (use fractional sample rate to trace a fraction of calls to decorated method) | |
oboe.config['tracing_mode'] = 'always' | |
oboe.config['sample_rate'] = 1.0 | |
@oboe.Context.trace('my_worker') | |
def do_something(): | |
... whatever you are tracing ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment