tff.profiler.TracingProvider

Stay organized with collections Save and categorize content based on your preferences.

Abstract base class for tracers.

Methods

receive_rpc

View source

Unpack parent_span_yield from the receiving end of an RPC.

span

View source

Create a new tracing span.

Args
scope String name of the scope, often the class name.
sub_scope String name of the sub-scope, often the function name.
nonce Number used to correlate tracing messages relating to the same function invocation.
parent_span_yield The value yielded by the most recently started (and not exited) call to span on this TracingProvider on the current asyncio.Task or thread (when running outside of an async context).
fn_args When this tracing provider wraps a function, this will be a tuple containing all of the non-keyword function arguments.
fn_kwargs When this tracing provider wraps a function, this will be a dict containing all of the keyword function arguments.
trace_opts User-provided options to the span constructor. TracingProviders should ignore unknown options.

Returns
A Generator which will be immediately started and run up until it yields for the first time. The value yielded by this Generator will be passed on to nested calls to span. When the spanned code ends, a TraceResult will be passed back through the yield.

wrap_rpc

View source

Wrap an RPC call so that it can carry over the parent_span_yield.