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

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