Skip to content
This repository has been archived by the owner on Jun 11, 2018. It is now read-only.

Differentiate between ajax and normal requests for performance overview #84

Open
mvantellingen opened this issue Nov 24, 2015 · 6 comments

Comments

@mvantellingen
Copy link
Contributor

It would be cool to split the performance overview in regular requests and ajax requests. We can achieve this ourselves by appending '_ajax' to the view name if request.is_ajax is true (in Django) via monkeypatching.

@roncohen
Copy link
Contributor

@mvantellingen thank you for this feature request. This could certainly be interesting. We've also considered differentiating different HTTP method requests to the same views. E.g. POST /api/users different from GET /api/user.

When we take another look at it, I will also be taking this issue into consideration. Thanks again!

@santiagomalter
Copy link

Hello @roncohen, I am particularly interested by the feature you mentioned, being able to distinguish HTTP requests served from the same django class based view. (GET /api/user/ vs POST /api/user/)

Is there any plan regarding this? Thanks!

And +1 for ajax vs. normal requests.

@beniwohli
Copy link
Member

@santiagomalter we shipped an implementation to distinguish between different http methods some months ago. If you don't see it, you might need to update your Opbeat module :)

@santiagomalter
Copy link

@piquadrat Thanks for the quick reply :) Indeed, my bad, I was trying to express something slightly different.

In a Django context, we have multiple API endpoints served by the same class based view, let's say:

GET /api/users/
GET /api/users/1/
GET /api/users/1/something/

They all appear under the same "view", but performance can be totally different so it would make sense to use to distinguish them and if I'm correct it's not possible right now, because everything is aggregated under the same HTTP Method + View.

But maybe it is too specific and you have no plan to add this feature? Solution could be to group requests by HTTP method + URL?

Thank you for your awesome work anyway :)

@beniwohli
Copy link
Member

@santiagomalter are you using a framework like tastypie or Django Rest Framework or custom class based views? For the latter, and if you use viewsets, there's this workaround: https://gist.github.com/piquadrat/b494bd4b368ea4095dad3b629333ae58

@santiagomalter
Copy link

Indeed, we are using Django Rest Framework. Thank you for the workaround, exactly what I was looking for, i'll implement that :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants