Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ways to write performance testing for Mercurial (hg) extension using Python

i wrote an extension for Mercurial e.g. hg dosomthing --rev 5 and I was wondering what is the right approach to writing performance test cases to monitor the performance of the extension from when its executed till its end!

Ta:)

like image 926
Simple-Solution Avatar asked Nov 25 '13 10:11

Simple-Solution


1 Answers

Mercurial has support for running itself under a Python profiler. Just execute

$ hg --profile dosomething --rev 5

and you'll see the profile output afterwards. See the hgrc man page for a few options you have. If you just want timing data, then use

$ hg --time dosomething --rev 5

instead.

You should also have a look at the perf extension. It runs a command many times (like the timeit module) and reports the best running time. You'll have to extend the extension to run your new command, but it should be simple since all the performance tests follow the same pattern.

like image 192
Martin Geisler Avatar answered Nov 15 '22 07:11

Martin Geisler