Hi,

I have written an SQLLogMiddleware:
  http://www.djangosnippets.org/snippets/344/

Maybe this helps you. But it only works if settings.DEBUG is true.

Ceph schrieb:
> Under settings.DEBUG=True, django.db.connection.queries is an array of
> all queries executed. Obviously storing every query in text is a
> memory hog. Would it still thrash as much if I wrote my own wrapper
> around a DB connection class via settings.DATABASE_ENGINE that
> implemented its own DebugCursorWrapper that timed and counted queries,
> but did not store the query text? Would the perf hit be as bad? I can
> see it adding up on views with many queries, but that's my goal:
> collect stats about actual production views where the query count/view
> time/rendering time may vary from development.
> 
> Or even better: does anyone have this written? I didn't see it on
> django snippets.


-- 
Thomas Guettler, http://www.thomas-guettler.de/
E-Mail: guettli (*) thomas-guettler + de

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to