Re: Database "execute hooks" for instrumentation

2017-09-15 Thread Shai Berger
On Friday 15 September 2017 11:35:49 Shai Berger wrote: > On Friday 15 September 2017 11:09:58 Anssi Kääriäinen wrote: > > > > def simple_execute_hook(execute): > > # One-time configuration and initialization. > > > > def execute_hook(sql, params, many, context): > > # Code

Re: Database "execute hooks" for instrumentation

2017-09-15 Thread Shai Berger
On Friday 15 September 2017 11:09:58 Anssi Kääriäinen wrote: > Would it make sense to use the same technique used for HTTP > request/response middleware? That is, the hook would look a bit like this: > > def simple_execute_hook(execute): > # One-time configuration and initialization. >

Re: Database "execute hooks" for instrumentation

2017-09-15 Thread Anssi Kääriäinen
Would it make sense to use the same technique used for HTTP request/response middleware? That is, the hook would look a bit like this: def simple_execute_hook(execute): # One-time configuration and initialization. def execute_hook(sql, params, many, context): # Code to be

Re: Database "execute hooks" for instrumentation

2017-09-14 Thread Shai Berger
In case you're interested and want to see this in 2.0, please help: https://code.djangoproject.com/ticket/28595 https://github.com/django/django/pull/9078 On Friday 14 April 2017 02:33:06 Adam Johnson wrote: > django-perf-rec would love this, > it

Re: Database "execute hooks" for instrumentation

2017-04-13 Thread Adam Johnson
django-perf-rec would love this, it currently monkey patches connection.ops.last_executed_query to listen to all the queries going on. On 7 April 2017 at 16:10, Shai Berger wrote: > On Friday 07 April 2017 17:47:51 Carl Meyer wrote:

Re: Database "execute hooks" for instrumentation

2017-04-07 Thread Shai Berger
On Friday 07 April 2017 17:47:51 Carl Meyer wrote: > Hi Shai, > > On 04/07/2017 06:02 AM, Shai Berger wrote: > > This is an idea that came up during the djangocon-europe conference: Add > > the ability to install general instrumentation hooks around the database > > "execute" and "executemany"

Re: Database "execute hooks" for instrumentation

2017-04-07 Thread Carl Meyer
Hi Shai, On 04/07/2017 06:02 AM, Shai Berger wrote: > This is an idea that came up during the djangocon-europe conference: Add the > ability to install general instrumentation hooks around the database > "execute" > and "executemany" calls. > > Such hooks would allow all sorts of interesting