Bug 1715408

Summary: dstat -dam not working properly
Product: Red Hat Enterprise Linux 8 Reporter: LiliDeng <lilideng>
Component: pcpAssignee: Nathan Scott <nathans>
Status: CLOSED DUPLICATE QA Contact: Jan Kurik <jkurik>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.0CC: agerstmayr, jkurik, mgoodwin, mnewsome, nathans, patrickm
Target Milestone: rcKeywords: Triaged
Target Release: 8.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: pcp-5.0.2-5.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-06 06:15:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description LiliDeng 2019-05-30 09:31:23 UTC
Description of problem:
dstat -dam not working

Version-Release number of selected component (if applicable):


How reproducible:
pcp-dstat 4.3.0
Written by the PCP team <pcp> and Dag Wieers <dag>
Homepages at https://pcp.io/ and http://dag.wieers.com/home-made/dstat/

Platform Linux
Kernel 4.18.0-80.el8.x86_64
Python 3.6.8 (default, Apr  3 2019, 17:26:03) 
[GCC 8.2.1 20180905 (Red Hat 8.2.1-3)]

Steps to Reproduce:
1. Run command dstat -dam


Actual results:
Traceback (most recent call last):
  File "/usr/bin/dstat", line 1632, in <module>
    dstat.execute()
  File "/usr/bin/dstat", line 1616, in execute
    scheduler.run()
  File "/usr/lib64/python3.6/sched.py", line 154, in run
    action(*argument, **kwargs)
  File "/usr/bin/dstat", line 1625, in perform
    op.perform(update)
  File "/usr/bin/dstat", line 1509, in perform
    line = line + sep + self.gshow(plugin, results)
  File "/usr/bin/dstat", line 1148, in gshow
    metric = op.metrics[plugin.mgroup[0]]
IndexError: list index out of range

Expected results:
No Error

Additional info:

Comment 1 Nathan Scott 2019-05-30 09:42:17 UTC
Hi there,

I think this may be because -d and -a have overlapping functionality - does it work correctly if you use 'dstat -am'?

We can certainly improve the tool by simply ignoring any duplicate column (-d) requests, which should resolve the issue.

cheers.

Comment 2 LiliDeng 2019-05-31 10:37:32 UTC
Thanks for your reply, 'dstat -am' works, if -d and -a can't use at the same time, it is better to meaning hints not throw an exception.

Comment 3 Nathan Scott 2019-06-02 21:51:20 UTC
(In reply to LiliDeng from comment #2)
> Thanks for your reply, 'dstat -am' works,

No problem - thanks for conforming.

> if -d and -a can't use at the same
> time, it is better to meaning hints not throw an exception.

Yes, definitely.  I'll fix that up.

cheers.

Comment 4 Nathan Scott 2019-06-02 22:01:44 UTC
Fixed upstream, will be merged into RHEL-8 with next PCP rebase.


commit e7ad59af398d191cf49e0df15a8dc49a9a4b53db
Author: Nathan Scott <nathans>
Date:   Mon Jun 3 08:00:16 2019 +1000

    pcp-dstat: ensure duplicate columns collapse to just one
    
    If the user directly or indirectly (eg via -a) requests
    the same column multiple times, collapse this to one so
    that the screen real estate is conserved.  Old versions
    of pcp-dstat would also throw a stack trace here.
    
    Update qa/1187 with new test cases exercising this.
    
    Resolves Red Hat BZ #1715408

Comment 6 Nathan Scott 2020-04-06 06:15:17 UTC
This fix was included in RHEL 8.2 via rebase.

*** This bug has been marked as a duplicate of bug 1723598 ***