Closed sparvu closed 9 years ago
No, sorry. You should be able to convert it yourself with 2-3 lines of code. Tomorrow the next one asks me to convert it to MB by default...
Imagine, I do that already Jonny. I was thinking that we could have for NIC and disks same unit as KBytes instead of bytes. No worries. I will keep it in my code.
Don't forget that S:S:L is just an interface to the proc-filesystem and to Linux system statistics. The data from the proc-filesystem will not be manipulated. As example the values of /proc/meminfo are in kilobytes, so S:S:L:MemStats returns the data in kilobytes; /proc/net/dev is in bytes, so S:S:L:NetStats returns the data in bytes. The only exception is that data in blocks (diskstats) or pages (memory) will be converted to bytes.
As example for diskstats... one block has a size of 512 bytes. If you want to convert it to kilobytes, just set the blocksize to 512 / 1024. Example:
my $sys = Sys::Statistics::Linux->new(diskstats => { blocksize => 512/1024 });
Another reason is... I cannot change the default behavior of a module without a serious cause.
yep. I was thinking we could offer a 'standard' KB unit within S:S:L no matter what. But in one sense its probable worse since it is natural to offer whatever /proc is offering and we let to other consumers to set it what they please.
Can we default to KB instead of bytes per second ? Is there any reason we still report bytes instead of KB for:
I agree we should have a smaller unit for small disk IO size but reporting to KB would make sense.
under DiskStats.pm