scottchiefbaker / dool

Python3 compatible fork of dstat
GNU General Public License v3.0
332 stars 64 forks source link

please add --dstat mode #65

Closed rpodgorny closed 5 months ago

rpodgorny commented 6 months ago

hello,

as arch linux has recently migrated from original dstat to dool as the "default dstat" implementation, i've found myself very confused when working with dool because the defaults are quite different from original dstat when running without any command line arguments.

i'm not questioning the choice of new defaults. it's just that using the new tool (and especially in combination with the old on non-updated systems) leads to confusion.

i suggest adding a --dstat (or --legacy or whatever) command line option to trigger behaviour that is as similar to original dstat as possible.

so far, my workaround is a script, that (so far) contains:

exec dool --bytes --cpu --disk --net --page --sys "$@"

...which keeps growing whenever if find some "surprise". also, this is not really a "fix" because there's no easy way to remove the specified options (so now i have to have cpu, disk, etc. shown even in cases when i don't want it).

i'm not sure if i have expressed myself in understandable way. i'm sorry if not and i'll try to rephrase my wish.

anyway, thanks for keeping this great tool alive!

scottchiefbaker commented 6 months ago

I'm not sure I'm following here. The only default that changed between dstat and dool is the use of bits instead of bytes for disk/bandwidth. What other behavior are you seeing?

scottchiefbaker commented 6 months ago

I had to dust off an old copy of dstat to refresh my memory. The "defaults" for dstat were: cpu, disk, network, paging, and system interrupts. The "defaults" for dool are: cpu, disk, network, load average, and time. Also disk/bandwidth are using bits instead of bytes.

I haven't heard from any other users anything negative about the changes. It's possible to add a --legacy param but I really doubt anyone would use it. It's probably easier for you just to create an alias on your local system:

alias dstat='dool --bytes --cpu --disk --net --page --sys "$@"'

Then when you run dstat you get the old functionality.

rpodgorny commented 6 months ago

well, recently i discovered i also need to use --color16 --ascii to make dool look the same as dstat... ...and there's probably more - i just don't know the differences, yet.

my ultimate goal to use dool as a drop-in replacement for dstat without users ever noticing. having legacy defaults hidden under a single command line option would help tremendously.

the alias you suggest (or the script i use) unfortunately does not fully achieve what i want. i'll try to explain with examples:

scottchiefbaker commented 5 months ago

I'm not 100% sold on a --dstat mode as I don't think it will get used much. That said, I looked at the code and it seems to be easier than I was thinking to implement. Please checkout the code in the dstat-mode branch that includes this potential feature. Tell me if it does what you're looking for.

rpodgorny commented 5 months ago

I'm not 100% sold on a --dstat mode as I don't think it will get used much. That said, I looked at the code and it seems to be easier than I was thinking to implement. Please checkout the code in the dstat-mode branch that includes this potential feature. Tell me if it does what you're looking for.

wow! perfect! this is exactly what i had in mind. thank you very much!

as for the usage, i can only talk for myself so i can't really judge the "global" impact and usage of this new functionality.

but i suspect a short paragraph in the man page saying something like "if you just migrated from dstat and want to use dool as a drop-in replacement, just use --dstat flag and go on with your life" would also help... ;-)

scottchiefbaker commented 5 months ago

Test it out for a couple of days... make sure it does everything you want and then report back. If it does what you want I'll land the feature.

rpodgorny commented 5 months ago

just reporting back that so far, there has been absolutely no problem. my wrapper script is:

#!/bin/sh
exec dool --dstat "$@"

named dstat and it emulates the original behaviour (at least for my use cases) perfectly.

scottchiefbaker commented 5 months ago

OK thanks for checking back in. I landed the --dstat stuff in next so it will go live with the next version.