Add --delta-threshold to pt-stalk that will monitor variables delta between samples

Registered by markus_albe on 2013-11-26

pt-stalk allows to set a --threshold for --variable value, but most variables in SHOW GLOBAL STATUS; increase monotonically, such that to be able to monitor these you always have to write a small plugin that works like this:

# not tested, but you'll get the idea
last_sample=0
if [ -f "$tmppath/previous-plugin-sample.dat" ]; then {
  last_sample=$(cat $tmppath/previous-plugin-sample.dat);
} fi;
current_sample=$(mysql -BNe "SHOW GLOBAL STATUS" |grep <wanted-var> |awk '{print $2}');
delta=$(($current_sample-$last_sample));
echo $current_sample > $tmppath/previous-plugin-sample.dat;
echo $delta;

Having an integrated mechanism to do this would be a great addition, and truly useful for almost anyone using pt-stalk often, allowing to monitor things like Opened_tables, Slow_queries, Threads_created, and many others that are quite significative performance indicators and can't currently be tracked easily

Blueprint information

Status:
Not started
Approver:
None
Priority:
Undefined
Drafter:
None
Direction:
Needs approval
Assignee:
None
Definition:
New
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.