[TIP] Running Coverage.py with Production load and getting the report every hour

Ankit Chopra ankitschopra at gmail.com
Sun Jan 22 23:54:16 PST 2017

Hi Ned,

Thanks for replying. Its a Python App running on django. Yes I can figure
out a way to gracefully stop it and start it again as we are running bunch
of the instances at a time. this is the option with us but I was looking
that if there is any configuration in coverage.py with which I can expect
the dump intermediately.
Another thing which if you can make me understand is how coverage.py keeps
data in memory.  Let say if i let it runs for a month, does it going to
increase the memory usage with time or it loads all the source code and
maintain a dictionary with flag 0 or 1 for every line.  If its like that
then it will not use the more memory with time, it will just mark the 1 for
the lines executed.

Ankit Chopra

On Mon, Jan 23, 2017 at 3:55 AM, Ned Batchelder <ned at nedbatchelder.com>

> On 1/22/17 4:04 AM, Ankit Chopra wrote:
> Hi All,
> We want to run coverage.py in our production application. We want to
> discover the obsolete code and see the report with actual production load.
> I have played with coverage.py tool and have seen that it creates the
> report after execution/termination and till that time it keeps everything
> in memory.
> Is there a way I can configure it to dump the report at regular interval
> like every hour or daily without stopping my application. and Later on I
> can merge and create a consolidated report.
> What kind of application is it, why does it run so long, and is there a
> natural unit of work that you could take advantage of? For example, if it's
> a web application, the simplest thing would be to measure coverage on a
> worker process, and start and stop workers on the frequency you want.
> --Ned.
> _______________________________________________
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
> http://lists.idyll.org/listinfo/testing-in-python
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20170123/ae6a2599/attachment.htm>

More information about the testing-in-python mailing list