Blame SOURCES/redhat-bugzilla-2083897-dstat-missed-ticks.patch

538a70
diff -Naurp pcp-5.3.7.orig/src/pcp/dstat/pcp-dstat.1 pcp-5.3.7/src/pcp/dstat/pcp-dstat.1
538a70
--- pcp-5.3.7.orig/src/pcp/dstat/pcp-dstat.1	2021-05-26 17:43:26.000000000 +1000
538a70
+++ pcp-5.3.7/src/pcp/dstat/pcp-dstat.1	2022-10-20 08:57:02.176922290 +1100
538a70
@@ -1,6 +1,6 @@
538a70
 '\"macro stdmacro
538a70
 .\"
538a70
-.\" Copyright (c) 2018-2020 Red Hat.
538a70
+.\" Copyright (c) 2018-2022 Red Hat.
538a70
 .\"
538a70
 .\" This program is free software; you can redistribute it and/or modify it
538a70
 .\" under the terms of the GNU General Public License as published by the
538a70
@@ -34,6 +34,7 @@
538a70
 [\f3\-\-integer\f1]
538a70
 [\f3\-\-nocolor\f1]
538a70
 [\f3\-\-noheaders\f1]
538a70
+[\f3\-\-nomissed\f1]
538a70
 [\f3\-\-noupdate\f1]
538a70
 [\f3\-\-list\f1]
538a70
 [\f3\-\-pidfile\f1 \f2pid-file\f1]
538a70
@@ -404,6 +405,9 @@ disable colors
538a70
 \fB\-\-noheaders\fR
538a70
 disable repetitive headers
538a70
 .TP
538a70
+\fB\-\-nomissed\fR
538a70
+disable missed ticks warnings for intermediate samples.
538a70
+.TP
538a70
 \fB\-\-noupdate\fR
538a70
 disable intermediate updates when \fIdelay\fR greater than 1.
538a70
 .TP
538a70
diff -Naurp pcp-5.3.7.orig/src/pcp/dstat/pcp-dstat.py pcp-5.3.7/src/pcp/dstat/pcp-dstat.py
538a70
--- pcp-5.3.7.orig/src/pcp/dstat/pcp-dstat.py	2022-04-05 09:05:43.000000000 +1000
538a70
+++ pcp-5.3.7/src/pcp/dstat/pcp-dstat.py	2022-10-20 08:57:02.176922290 +1100
538a70
@@ -455,6 +455,7 @@ class DstatTool(object):
538a70
 
538a70
         # Internal
538a70
         self.missed = 0
538a70
+        self.nomissed = False # report missed ticks by default
538a70
         self.runtime = -1
538a70
         self.plugins = []     # list of requested plugin names
538a70
         self.allplugins = []  # list of all known plugin names
538a70
@@ -783,7 +784,8 @@ class DstatTool(object):
538a70
         opts.pmSetLongOption('color', 0, '', '', 'force colors')
538a70
         opts.pmSetLongOption('nocolor', 0, '', '', 'disable colors')
538a70
         opts.pmSetLongOption('noheaders', 0, '', '', 'disable repetitive headers')
538a70
-        opts.pmSetLongOption('noupdate', 0, '', '', 'disable intermediate headers')
538a70
+        opts.pmSetLongOption('noupdate', 0, '', '', 'disable intermediate updates')
538a70
+        opts.pmSetLongOption('nomissed', 0, '', '', 'disable missed ticks warnings')
538a70
         opts.pmSetLongOption('output', 1, 'o', 'file', 'write CSV output to file')
538a70
         opts.pmSetLongOption('version', 0, 'V', '', '')
538a70
         opts.pmSetLongOption('debug', 1, None, '', '')
538a70
@@ -920,6 +922,8 @@ class DstatTool(object):
538a70
             self.header = False
538a70
         elif opt in ['noupdate']:
538a70
             self.update = False
538a70
+        elif opt in ['nomissed']:
538a70
+            self.nomissed = True
538a70
         elif opt in ['o', 'output']:
538a70
             self.output = arg
538a70
         elif opt in ['pidfile']:
538a70
@@ -1773,12 +1777,12 @@ class DstatTool(object):
538a70
             outputfile = open(self.output, omode)
538a70
             outputfile.write(oline)
538a70
 
538a70
-        if self.missed > 0:
538a70
+        if self.missed > 0 and self.nomissed is False:
538a70
             line = 'missed ' + str(self.missed + 1) + ' ticks'
538a70
             sys.stdout.write(' ' + THEME['error'] + line + THEME['input'])
538a70
             if self.output and step == self.delay:
538a70
                 outputfile.write(',"' + line + '"')
538a70
-            self.missed = 0
538a70
+        self.missed = 0
538a70
         # Finish the line
538a70
         if not op.update and self.novalues is False:
538a70
             sys.stdout.write('\n')