cubicweb.pyramid.profile#

Tools for profiling.

See Profiling.

Views#

cubicweb.pyramid.profile.ping(request)[source]#

View that handle ‘/_profile/ping’

It simply reply ‘ping’, without requiring connection to the repository. It is a useful as a comparison point to evaluate the actual overhead of more costly views.

cubicweb.pyramid.profile.cnx(request)[source]#

View that handle ‘/_profile/cnx’

Same as ping(), but it first ask for a connection to the repository. Useful to evaluate the overhead of opening a connection.

WSGI#

cubicweb.pyramid.profile.wsgi_profile(app, filename='program.prof', dump_every=50)[source]#

A WSGI middleware for profiling

It enable the profiler before passing the request to the underlying application, and disable it just after.

The stats will be dumped after dump_every requests

Parameters
  • filename – The filename to dump the stats to.

  • dump_every – Number of requests after which to dump the stats.