GreenletProfiler functions

GreenletProfiler.start(builtins=False, profile_threads=True)

Starts profiling all threads and all greenlets.

This function can be called from any thread at any time. Resumes profiling if stop() was called previously.

  • builtins: Profile builtin functions used by standart Python modules.
  • profile_threads: Profile all threads if True, else profile only the calling thread.
GreenletProfiler.stop()

Stops the currently running yappi instance.

The same profiling session can be resumed later by calling start().

GreenletProfiler.clear_stats()

Clears all of the profile results.

GreenletProfiler.get_func_stats()

Gets the function profiler results with given filters and returns an iterable.

GreenletProfiler.get_thread_stats()

Gets the thread profiler results with given filters and returns an iterable.

GreenletProfiler.is_running()

Returns true if the profiler is running, false otherwise.

GreenletProfiler.get_clock_type()

Returns the OS api used for timing plus the precision and the clock type information in a dict.

GreenletProfiler.set_clock_type(type)

Sets the internal clock type for timing. Profiler shall not have any previous stats. Otherwise an exception is thrown.

GreenletProfiler.get_mem_usage()

Returns the internal memory usage of the profiler itself.

GreenletProfiler.convert2pstats(stats)

Converts the internal stat type of yappi(which is returned by a call to YFuncStats.get()) as pstats object.