summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtsp/watchers/watch_target_queues.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/tsp/watchers/watch_target_queues.sh b/tsp/watchers/watch_target_queues.sh
index 5380484..2d4df31 100755
--- a/tsp/watchers/watch_target_queues.sh
+++ b/tsp/watchers/watch_target_queues.sh
@@ -19,10 +19,21 @@ export TSP_DIR="$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd -P)/.."
. "${TSP_DIR}/common.sh"
+TIMES_NAME="tsrun_time"
+TIMES="$(mktemp)"
+{
+ echo "# HELP $TIMES_NAME Execution time of the most recent command"
+ echo "# TYPE $TIMES_NAME gauge"
+} > "$TIMES"
+
for ltarget in $TARGET_LIST
do
target="${ltarget#*-}"
COUNT="$(tsrun_target "${target}" | grep queued | wc -l)"
# Report queue length
post_prom "tsrun_queued_${target}" "$COUNT" "Length of ${target} queue"
+ TIME="$(tsrun_target "${target}" -i | grep -o "[0-9]\+\.[0-9]\+")"
+ echo "${TIMES_NAME}{target=\"${ltarget}\"} $TIME" >> "$TIMES" #FIXME use real target instead of l-target
done
+
+mv "$TIMES" "$PROM_DIR/tsrun_times.prom"