Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disk device filter does not work under disk-util and disk-wait. #2016

Closed
NyBT-spec opened this issue Jul 10, 2024 · 3 comments
Closed

Disk device filter does not work under disk-util and disk-wait. #2016

NyBT-spec opened this issue Jul 10, 2024 · 3 comments

Comments

@NyBT-spec
Copy link

I installed pcp-dstat (5.3.7) from redhat 8 repo
The device filter does not work under --disk-util and --disk-wait.

working example:
root# dstat --disk-tps 1 1 -D scinia
-dsk/scinia
#read #writ
0 0

non-working sample:

root# dstat --disk-util 1 1 -D scinia
sda--scin-scin-scin-scin-scin-scin-scin-scin-scin-scin-scin-scin-scin-scin-scin-scin-scin-scin
util:util:util:util:util:util:util:util:util:util:util:util:util:util:util:util:util:util:util
0.10: 0: 0: 0: 0: 0: 0: 0: 0: 0: 0: 0: 0: 0: 0: 0: 0: 0: 0

root# dstat --disk-wait 1 1 -D scinia
---sda------scinia----scinib----scinic----scinid----scinie----scinif----scinig----scinih----scinii----scinij----scinik----scinil----scinim----scinin----scinio----scinip----sciniq----scinir-
rawa wawa:rawa wawa:rawa wawa:rawa wawa:rawa wawa:rawa wawa:rawa wawa:rawa wawa:rawa wawa:rawa wawa:rawa wawa:rawa wawa:rawa wawa:rawa wawa:rawa wawa:rawa wawa:rawa wawa:rawa wawa:rawa wawa
0 0.00: 0 0: 0 0: 0 0: 0 0: 0 0: 0 0: 0 0: 0 0: 0 0: 0 0: 0 0: 0 0: 0 0: 0 0: 0 0: 0 0: 0 0: 0 0

Is there any way I can fix this or do I have to wait for a fix?

@natoscott
Copy link
Member

@NyBT-spec thanks for reporting - this is a newly discovered issue, and I see the same behaviour in the latest version of the code too:

$ pcp --archive qa/archives/bozo-disk --start @10:32 dstat --time --disk-util 10 3 -D sda,sdb
----system---- sda--sdb--sdc--sdd--sde-
     time     |util:util:util:util:util
16-03 10:32:00|    :    :    :    :    
16-03 10:32:10|1.22:0.86:0.54:94.9:0.22
16-03 10:32:20|0.16:0.55:0.46:92.6:0.12
16-03 10:32:30|0.05:0.65:0.08:91.8:0.59

I'll take a closer look when I can, but to answer your questions: at this stage there is no fix available.

@natoscott
Copy link
Member

Heh, scanning the code 1 minute after pressing 'Comment' I see the reason for this. Have a look at the code (python) in prepare_metrics() - around line 688 in the main git branch, which looks like this:

                # Instance logic for -C/-D/-L/-M/-P/-I/-N/-S options
                if section == 'cpu':
                    plugin.prepare_grouptype(self.cpulist, self.full)
                elif section in ['disk', 'disk-tps']:
                    plugin.prepare_grouptype(self.disklist, self.full)

What this is saying is that some plugins are "special" and the filtering options (like -D in your cases) are manually associated with these plugins. If you change the set (plugin names) in that second line, to be like this:

                elif section in ['disk', 'disk-tps', 'disk-util']

you'll see the behavior you seek from --disk-util I believe. Not sure how best to solve this, this is a bit of a hangover from the original dstat mechanisms. Perhaps an extension to the /etc/pcp/dstat/disk config format to identify which command line option (-D, -C, etc) provides the filter string for that plugin.

Anyway, hopefully this is enough (manually editing the script for now) to get you the functionality you need today, and we can think about cleaner solutions in time.

@NyBT-spec
Copy link
Author

Thanks, it works fine like this:
elif section in ['disk', 'disk-tps', 'disk-util', 'disk-wait']:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants