Commit d4eda7ea authored by Julien Muchembled's avatar Julien Muchembled

CMFActivity: show InnoDB history list length in console watcher

parent b559f4c5
...@@ -32,6 +32,7 @@ INTERVAL=$2 ...@@ -32,6 +32,7 @@ INTERVAL=$2
} }
node_priority_cols="processing_node AS node, MIN(priority) AS min_pri, MAX(priority) AS max_pri" node_priority_cols="processing_node AS node, MIN(priority) AS min_pri, MAX(priority) AS max_pri"
count='(SELECT count AS "InnoDB history list length" FROM information_schema.innodb_metrics WHERE name="trx_rseg_history_len") as i'
for t in message:dict message_queue:queue message_job:joblib; do for t in message:dict message_queue:queue message_job:joblib; do
table=${t%:*} table=${t%:*}
t=${t#*:} t=${t#*:}
...@@ -58,15 +59,11 @@ for t in message:dict message_queue:queue message_job:joblib; do ...@@ -58,15 +59,11 @@ for t in message:dict message_queue:queue message_job:joblib; do
TIME_FORMAT(TIMEDIFF(UTC_TIMESTAMP(6), MAX(max_date)), \"%T\") AS min, TIME_FORMAT(TIMEDIFF(UTC_TIMESTAMP(6), MAX(max_date)), \"%T\") AS min,
TIME_FORMAT(TIMEDIFF(UTC_TIMESTAMP(6), MIN(min_date)), \"%T\") AS max TIME_FORMAT(TIMEDIFF(UTC_TIMESTAMP(6), MIN(min_date)), \"%T\") AS max
FROM _$t GROUP BY priority ORDER BY priority;" FROM _$t GROUP BY priority ORDER BY priority;"
[ "$count" ] && { not_processing=${not_processing:+$not_processing UNION ALL }"
not_processing=$not_processing" UNION ALL "
count=$count,
}
not_processing=$not_processing"
SELECT IFNULL(SUM(n),0) AS count, $node_priority_cols, SELECT IFNULL(SUM(n),0) AS count, $node_priority_cols,
MIN(min_date) AS min_date, MAX(max_date) AS max_date MIN(min_date) AS min_date, MAX(max_date) AS max_date
FROM _$t WHERE processing_node<=0 GROUP BY processing_node" FROM _$t WHERE processing_node<=0 GROUP BY processing_node"
count=$count"(SELECT IFNULL(SUM(n),0) AS $t FROM _$t) as $t" count=$count",(SELECT IFNULL(SUM(n),0) AS $t FROM _$t) as $t"
total=$total+$t total=$total+$t
done done
exec watch -n ${INTERVAL:-5} "${MYSQL:-mysql} $MYSQL_OPT --disable-pager -t -e ' exec watch -n ${INTERVAL:-5} "${MYSQL:-mysql} $MYSQL_OPT --disable-pager -t -e '
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment