Opened 12 years ago

Closed 8 years ago

#2452 enhancement closed wontfix (wontfix)

Add a timestamp to web2.server.Request for performance tracking

Reported by: Cyrus Daboo Owned by:
Priority: normal Milestone:
Component: web2 Keywords:
Cc: Jean-Paul Calderone, Thijs Triemstra Branch:


It is useful to record in an access log the total time taken to process a request. I propose adding an attribute to the init method of Request that records the time when the request object is created. That timestamp can then be used later during the processing of the request to determine elapsed time or to print the total request time in an access log when the request is complete. This will also aid with tracking down performance issues by making it easy to log elapsed time during different portions of request processing.

Proposed patches attached. One adds the timestamp to the Request object, the other modifies the access log output to include the total request elapsed time in milliseconds.

Attachments (2)

server.patch (458 bytes) - added by Cyrus Daboo 12 years ago.
log.patch (886 bytes) - added by Cyrus Daboo 12 years ago.

Download all attachments as: .zip

Change History (6)

Changed 12 years ago by Cyrus Daboo

Attachment: server.patch added

Changed 12 years ago by Cyrus Daboo

Attachment: log.patch added

comment:1 Changed 12 years ago by Cyrus Daboo

Keywords: review added

comment:2 Changed 12 years ago by Jean-Paul Calderone

Cc: Jean-Paul Calderone added
Keywords: review removed

There should be test coverage for this functionality. Preferably the clock used (time.time) should be parameterized so that the tests are deterministic. It might also be useful if either wallclock time or CPU time could be logged (or both), but that's more a new feature request than criticism of this patch.

I'm not sure about this, but I think the current log format is based some standard (de facto or otherwise). Does the addition of a new field break this?

comment:3 Changed 8 years ago by <automation>

Owner: jknight deleted

comment:4 Changed 8 years ago by Thijs Triemstra

Cc: Thijs Triemstra added
Resolution: wontfix
Status: newclosed

web2's gone.

Note: See TracTickets for help on using tickets.