Description of problem: When invoking dstat with an explicit count of n it actually just prints n-1 updates. Version-Release number of selected component (if applicable): pcp-system-tools-5.2.3-1.fc33.x86_64 How reproducible: always Steps to Reproduce: 1. dstat 1 3 2. dstat 1 1 3. Actual results: You did not select any stats, using -cdngy by default. ----total-usage---- -dsk/total- -net/total- ---paging-- ---system-- usr sys idl wai stl| read writ| recv send| in out | int csw 15 4 80 0 0| 0 811k| 25k 1119B| 0 0 |3721 4738 18 5 77 0 0| 0 0 | 27k 980B| 0 0 |3789 4659 You did not select any stats, using -cdngy by default. ----total-usage---- -dsk/total- -net/total- ---paging-- ---system-- usr sys idl wai stl| read writ| recv send| in out | int csw Expected results: Three updates, in total - i.e. something like this: You did not select any stats, using -cdngy by default. ----total-usage---- -dsk/total- -net/total- ---paging-- ---system-- usr sys idl wai stl| read writ| recv send| in out | int csw 15 4 80 0 0| 0 811k| 25k 1119B| 0 0 |3721 4738 18 5 77 0 0| 0 0 | 27k 980B| 0 0 |3789 4659 16 5 77 0 0| 0 0 | 27k 1980B| 0 0 |3780 4653 Followed by one update: You did not select any stats, using -cdngy by default. ----total-usage---- -dsk/total- -net/total- ---paging-- ---system-- usr sys idl wai stl| read writ| recv send| in out | int csw 17 5 77 0 0| 0 0 | 24k 909B| 0 0 |3937 4912 Additional info: The result of the second invocation seems to be a regression - cf. #1449687 Note that the current dstat behavior is also inconsistent with similar tools such as vmstat.
Thanks Georg! This patch seems to resolve the issue, lightly tested only so far: diff --git a/src/pcp/dstat/pcp-dstat.py b/src/pcp/dstat/pcp-dstat.py index b8d786bd5..e5c20fba2 100755 --- a/src/pcp/dstat/pcp-dstat.py +++ b/src/pcp/dstat/pcp-dstat.py @@ -705,7 +705,7 @@ class DstatTool(object): sys.exit(1) if len(operands) > 1: try: - self.samples = int(operands[1]) + self.samples = int(operands[1]) + 1 except: sys.stderr.write("Invalid sample count '%s'\n" % operands[1]) sys.exit(1) I'll do some more testing (haven't checked archives yet, nor updated the regression tests) and get this fixed in pcp-5.2.4. cheers.
FEDORA-2021-c64d2658a0 has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2021-c64d2658a0
FEDORA-2021-4e2b6f6f82 has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2021-4e2b6f6f82
FEDORA-2021-c64d2658a0 has been pushed to the Fedora 33 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-c64d2658a0` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-c64d2658a0 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2021-4e2b6f6f82 has been pushed to the Fedora 32 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-4e2b6f6f82` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-4e2b6f6f82 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2021-c64d2658a0 has been pushed to the Fedora 33 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-2021-4e2b6f6f82 has been pushed to the Fedora 32 stable repository. If problem still persists, please make note of it in this bug report.