Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added middleware for timing request processing per view. #4

Closed
wants to merge 4 commits into from

Conversation

rlr
Copy link
Contributor

@rlr rlr commented Jun 13, 2011

r?

if hasattr(request, '_view_name'):
ms = int((time.time() - request._start_time) * 1000)
statsd.timing('view.{v}.{m}'.format(v=request._view_name,
m=request.method), ms)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move the request.method bit up to the process_view method so all the string formatting is together? Or is the request method not set at that point?

@jsocol
Copy link
Contributor

jsocol commented Jun 13, 2011

Looks good!

@rlr
Copy link
Contributor Author

rlr commented Jun 13, 2011

137edfe

@rlr rlr closed this Jun 13, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants