use Proc::ProcTable rather than ps and pgrep collab/gmcharlt/better_osrf_control_diagnostic
authorGalen Charlton <gmc@esilibrary.com>
Fri, 6 Feb 2015 17:50:22 +0000 (17:50 +0000)
committerGalen Charlton <gmc@esilibrary.com>
Fri, 6 Feb 2015 17:50:22 +0000 (17:50 +0000)
commitfdbfa9a19183976782072e26e0999e8f4b22f632
tree38a02db1806c5474337be7269ddf0db7e66309a2
parentd935b0910a141eb5c4c643d209debae142d00d08
use Proc::ProcTable rather than ps and pgrep

Rather than spawn off repeated shell calls to ps
and pgrep when running osrf_control --diagnostic
or --kill-with-fire, use Proc::ProcTable.  This
should result in better portability, and also runs
faster.

For example, prior to this patch, osrf_control -l --diagnostic
resulted in the following timing:

real    0m2.981s
user    0m1.152s
sys     0m2.284s

With this patch:

real    0m0.884s
user    0m0.580s
sys     0m0.328s

New Perl dependencies are:

  Proc::ProcessTable
  DateTime::Format::Duration

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
bin/opensrf-perl.pl.in
src/extras/Makefile.install