Sounds like you want retrieving statistics from uWSGI's stats server.

http://uwsgi-docs.readthedocs.io/en/latest/StatsServer.html

In order to get that JSON via HTTP requests, your server ".ini" should
receive extra arguments to start an stats server listening to the
specified port and application must be somehow aware of such port
number, which has a side-effect of increasing coupling.

Sincerely,

Adler

On 07/12/2017 13:13, Etienne Robillard wrote:
> Hi,
>
> I would like to access the uWSGI stats API from within Django by
> creating a custom WSGI middleware.
>
> Could it be possible to compute the number of requests currently being
> used by uWSGI workers in Python/Django ?
>
> Ideally, i could then retrieve the active connections in use in a
> standard Django view:
>
> def someview(request):
>
>     # retrieve the number of active requests (connections)
>
>     connections = request.environ['uwsgi.requests']
>
>
> What do you think?
>
>
> Etienne
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c6d79973-28b8-5236-a64e-4c24ed3c30a7%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to