There may be better methods but I'd just instrument the code to spit
out timestamps at various points in its run. I'd use this method
because the git module invokes the git command line frequently so
chances are that one of the git command line calls is what's slow.
Putting some code to log the time around the calls to external git
will let you track down which call it is and also doesn't require you
to learn a lot of python to get started.
For doing this quick and dirty, I would use the python-q library which
does simplistic logging to $TMPDIR/q:
https://pypi.python.org/pypi/q
With it you can put lines in your code like:
import q, time; q.q('before: %s' % time.time())
# [git module gets invoked]
q.q('after: %s' % time.time())
Then $TMPDIR/q on the box ansible is talking to will contain these timestamps.
If you want to get more involved, you can look into several modules
from the python stdlib including timeit
https://docs.python.org/2/library/timeit.html and profile:
https://docs.python.org/2/library/profile.html but these will require
learning a bit more python and probably aren't needed for the
granularity of this particular problem.
-Toshio
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
ansible-proje...@googlegroups.com.
> To post to this group, send email to
ansible...@googlegroups.com.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/ansible-project/2597e894-30e6-4ada-afb1-3e14fe37aa90%40googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.