Blame SOURCES/bz1835885-1-stats-Add-basic-schedule-miss-stats-to-needle.patch

c29fdf
From 274fda334a84253222e01b779349784ec552921b Mon Sep 17 00:00:00 2001
c29fdf
From: Christine Caulfield <ccaulfie@redhat.com>
c29fdf
Date: Fri, 21 Feb 2020 09:20:29 +0000
c29fdf
Subject: [PATCH] stats: Add basic schedule-miss stats to needle
c29fdf
c29fdf
In camelback (48b6894ef41e9a06ccbb696d062d86ef60dc2c4b) we have
c29fdf
a much more comprehensive system for recording
c29fdf
schedule misses because it has a 'stats' map. This is much more basic
c29fdf
and just writes the last event into cmap. You can still query and track
c29fdf
the value though.
c29fdf
c29fdf
Signed-off-by: Christine Caulfield <ccaulfie@redhat.com>
c29fdf
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
c29fdf
---
c29fdf
 exec/main.c     |  3 +++
c29fdf
 man/cmap_keys.8 | 10 ++++++++++
c29fdf
 2 files changed, 13 insertions(+)
c29fdf
c29fdf
diff --git a/exec/main.c b/exec/main.c
c29fdf
index 787d5c9..204abc8 100644
c29fdf
--- a/exec/main.c
c29fdf
+++ b/exec/main.c
c29fdf
@@ -852,6 +852,9 @@ static void timer_function_scheduler_timeout (void *data)
c29fdf
 		log_printf (LOGSYS_LEVEL_WARNING, "Corosync main process was not scheduled for %0.4f ms "
c29fdf
 		    "(threshold is %0.4f ms). Consider token timeout increase.",
c29fdf
 		    (float)tv_diff / QB_TIME_NS_IN_MSEC, (float)timeout_data->max_tv_diff / QB_TIME_NS_IN_MSEC);
c29fdf
+
c29fdf
+		icmap_set_float("runtime.schedmiss.delay", (float)tv_diff / QB_TIME_NS_IN_MSEC);
c29fdf
+		icmap_set_uint64("runtime.schedmiss.timestamp", qb_util_nano_from_epoch_get() / QB_TIME_NS_IN_MSEC);
c29fdf
 	}
c29fdf
 
c29fdf
 	/*
c29fdf
diff --git a/man/cmap_keys.8 b/man/cmap_keys.8
c29fdf
index b0cd721..1045c65 100644
c29fdf
--- a/man/cmap_keys.8
c29fdf
+++ b/man/cmap_keys.8
c29fdf
@@ -256,6 +256,16 @@ Status of the processor. Can be one of joined and left.
c29fdf
 Config version of the member node.
c29fdf
 
c29fdf
 .TP
c29fdf
+runtime.schedmiss.timestamp
c29fdf
+The timestamp of the last time when corosync failed to be scheduled
c29fdf
+for the required amount of time. The even is warned in syslog but this
c29fdf
+is easier to find. The time is milli-seconds since the epoch.
c29fdf
+
c29fdf
+.B
c29fdf
+runtime.schedmiss.delay
c29fdf
+The amount of time (milliseconds as a float) that corosync was delayed.
c29fdf
+
c29fdf
+.TP
c29fdf
 resources.process.PID.*
c29fdf
 Prefix created by applications using SAM with CMAP integration.
c29fdf
 It contains the following keys:
c29fdf
-- 
c29fdf
1.8.3.1
c29fdf