Question

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:)

Était-ce utile?

La solution

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top