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

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