~mojo-maintainers/mojo/trunk

Viewing all changes in revision 496.

  • Committer: mergebot at canonical
  • Author(s): "Daniel Manrique"
  • Date: 2019-04-19 01:25:24 UTC
  • mfrom: (494.2.5 parallel-nagios-check)
  • Revision ID: mergebot@juju-139df4-prod-is-toolbox-0.canonical.com-20190419012524-44wrayrluc0785rd
Verify nagios checks in parallel.

This uses Python's futures module for minimal-change parallel execution of nagios checks; one parallel "juju ssh" is dispatched for each  machine to check, and results are presented as they arrive. The logic and presentation stay the same otherwise.

I didn't declare futures as an explicit deb dependency (only in requirements.txt) because in the deb world, mojo depends on codetree which depends on futures, so they should always be there.

I added a couple of tests to verify the expected number of juju sshs is dispatched, and that the number of workers is properly calculated.

A possible refinement would be ability to specify a maximum number of workers; this could help if e.g. simultaneous juju ssh to a large number of units on a complex deployment causes any kind of trouble.

A couple of tweaks to the "juju ssh" command line were needed to avoid the display/pty getting borked when running several tasks in parallel, but I checked and they don't affect the visual output of things.

Reviewed-on: https://code.launchpad.net/~roadmr/mojo/parallel-nagios-check/+merge/366076
Reviewed-by: Stuart Bishop <stuart.bishop@canonical.com>

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: