pt-stalk --plugin
Add hooks in pt-stalk that a --plugin script.sh can define to extend the tool's functionality in key areas like before and after collecting.
Originally requested via bug 1001004.
Blueprint information
- Status:
- Complete
- Approver:
- None
- Priority:
- High
- Drafter:
- None
- Direction:
- Approved
- Assignee:
- Daniel Nichter
- Definition:
- Approved
- Series goal:
- None
- Implementation:
- Implemented
- Milestone target:
- 2.1.6
- Started by
- Daniel Nichter
- Completed by
- Daniel Nichter
Whiteboard
As of 2.1.6, pt-stalk has:
=item --plugin
type: string
Load a plugin to hook into the tool and extend is functionality.
The specified file does not need to be executable, nor does its first line
need to be shebang line. It only needs to define one or more of these
Bash functions:
=over
=item before_stalk
Called before stalking.
=item before_collect
Called when the stalk condition is triggered, before running a collector
process as a backgrounded subshell.
=item after_collect
Called after running a collector process. The PID of the collector process
is passed as the first argument. This hook is called before
C<after_
=item after_collect_sleep
Called after sleeping L<"--sleep"> seconds for the collector process to finish.
This hook is called after C<after_collect>.
=item after_stalk
Called after stalking. Since pt-stalk stalks forever by default,
this hook is only called if L<"--iterations"> is specified.
=back