Re: uwsgi stats middleware for Django

2017-12-09 Thread Ádler Oliveira Silva Neves
Hello once more time, Etienne! There's a GitHub gist from two years ago on making a Django application use asyncio. A consequence of bringing such data through middlewares is that you will trigger a HTTP request against localhost

Re: uwsgi stats middleware for Django

2017-12-09 Thread Etienne Robillard
Dear Adler, Thanks again for sharing your code with us. Do you think it would be possible to use asyncio to defer the computation of the active connections from the view or middleware ? Best regards, Etienne Le 2017-12-08 à 11:19, Adler Neves a écrit : forgot mentioning: the number of

Re: uwsgi stats middleware for Django

2017-12-08 Thread Adler Neves
forgot mentioning: the number of active requests is given by "Threads busy" progress bar and in "Busy threads" line of the table of the previous reply. Em sexta-feira, 8 de dezembro de 2017 14:07:42 UTC-2, Adler Neves escreveu: > > Hello again, Etienne! > > The way you coded that, you are

Re: uwsgi stats middleware for Django

2017-12-08 Thread Adler Neves
Hello again, Etienne! The way you coded that, you are counting how many requests the server has replied before your request has been processed. A bit differently than you, I implemented it as a view (which is not hard to convert into middleware component) that uses bootstrap, so some small

Re: uwsgi stats middleware for Django

2017-12-08 Thread Etienne Robillard
Hi Ádler, Thank you for your reply. Can you please review this code before I commit? """uWSGIController API Version 0.8.3 Middleware for storing uWSGI statistics into the environ object. """ import sys import os import logging import demjson import urllib logger =

Re: uwsgi stats middleware for Django

2017-12-07 Thread Ádler Oliveira Silva Neves
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

uwsgi stats middleware for Django

2017-12-07 Thread Etienne Robillard
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