midgard.dev.profiler

Add a profiler when running

Supports several profilers including cprofile, line_profiler, memprof and memory_profiler.

CProfile

CProfile()

cprofile is used for profiling the whole program

CProfile.end()

end(self)

Stop profiler

CProfile.extension (NotImplementedType)

extension = NotImplemented

CProfile.option (str)

option = '--profiler'

CProfile.pip_name (str)

pip_name = 'cprofile'

CProfile.setup()

setup(self, options)

Set up profiler

CProfile.show()

show(self)

Show results of profiler session in console

CProfile.start()

start(self)

CProfile.write()

write(self)

Write results of profiler session to disk

LineProfiler

LineProfiler()

line_profiler is used to profile one or a few functions in detail

LineProfiler.end()

end(self)

Stop profiler

LineProfiler.extension (NotImplementedType)

extension = NotImplemented

LineProfiler.option (str)

option = '--line_profiler'

LineProfiler.pip_name (str)

pip_name = 'line_profiler'

LineProfiler.setup()

setup(self, options)

Set up profiler

LineProfiler.show()

show(self)

Show results of profiler session in console

LineProfiler.start()

start(self)

Start profiler

LineProfiler.write()

write(self)

Write results of profiler session to disk

Profiler

Profiler()

Base class for profilers

Profiler.end()

end(self)

Stop profiler

Profiler.extension (NotImplementedType)

extension = NotImplemented

Profiler.option (NotImplementedType)

option = NotImplemented

Profiler.pip_name (NotImplementedType)

pip_name = NotImplemented

Profiler.setup()

setup(self, options)

Set up profiler

Profiler.show()

show(self)

Show results of profiler session in console

Profiler.start()

start(self)

Start profiler

Profiler.write()

write(self)

Write results of profiler session to disk