webedx-spark/django — pull request #3 by marcgrr (2013-05-02 04:18:43+00:00)
Title: Add sampled query logging

@nickdella @saeta @bipincoursera

This adds some sampled query logging to our django. Log entries are of the form:
() ()

...

I assume we can then use sumo logic to aggregate all this and tell us stuff that we want, as long as we dump these log messages to the console_log. Is this right?

Any extra feature requests or thoughts about implementation? There doesn't seem to be anything storing the size in bytes of the results, so I would have to estimate that by peeking at a row of results and multiplying its size by the number of rows. That seems like more trouble than it's worth for immediately, and I think #rows should do well enough as an approximation of size.

This uses a constant SUBSAMPLE_LOG_QUERIES from settings.py to decide how much to subsample. We must therefore merge https://github.com/webedx-spark/site/pull/2772/files before merging this.