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

Show Graph data with MBit instead of Mbps #92

Open
borzel opened this issue Aug 13, 2018 · 9 comments
Open

Show Graph data with MBit instead of Mbps #92

borzel opened this issue Aug 13, 2018 · 9 comments
Assignees
Labels
Milestone

Comments

@borzel
Copy link
Member

@borzel borzel commented Aug 13, 2018

make it configurable

@borzel borzel added the enhancement label Sep 13, 2018
@Kalloritis

This comment has been minimized.

Copy link

@Kalloritis Kalloritis commented Dec 23, 2018

Has there been any progression on this?

I for one would like to see Mbps for network throughput, but disk throughput be MBps- I also agree though that these should be configurable to the user.

@borzel

This comment has been minimized.

Copy link
Member Author

@borzel borzel commented Dec 25, 2018

We do it when we have spare time. Or someone else has time - hey it's open source!

@borzel borzel added this to the Next Release milestone Feb 7, 2019
@Gatak

This comment has been minimized.

Copy link

@Gatak Gatak commented Mar 13, 2019

I was always confused as to what the graphs showed. Ideally, I think, graphs should use IEC units.
The former kilobytes, megabytes, gigabytes becomes KiB, MiB, GiB, and so on. The same for speeds; MiB/s, GiB/s...

https://en.wikipedia.org/wiki/Mebibyte

@borzel borzel modified the milestones: 8.0, 8.0.1 May 11, 2019
@borzel borzel self-assigned this May 21, 2019
@borzel

This comment has been minimized.

Copy link
Member Author

@borzel borzel commented May 21, 2019

Here the calculation of the "MBps" is performed, if isRate is true

private static string ByteSizeString(double bytes, int decPlaces, bool isRate, out string unit, string format = null)
{
if (bytes >= BINARY_TERA)
{
unit = isRate ? Messages.VAL_TERRATE : Messages.VAL_TERB;
var result = Math.Round(bytes / BINARY_TERA, decPlaces);
return string.IsNullOrEmpty(format) ? result.ToString() : result.ToString(format);
}
if (bytes >= BINARY_GIGA)
{
unit = isRate ? Messages.VAL_GIGRATE : Messages.VAL_GIGB;
var result = Math.Round(bytes / BINARY_GIGA, decPlaces);
return string.IsNullOrEmpty(format) ? result.ToString() : result.ToString(format);
}
if (bytes >= BINARY_MEGA)
{
unit = isRate ? Messages.VAL_MEGRATE : Messages.VAL_MEGB;
var result = Math.Round(bytes / BINARY_MEGA, decPlaces);
return string.IsNullOrEmpty(format) ? result.ToString() : result.ToString(format);
}
if (bytes >= BINARY_KILO)
{
unit = isRate ? Messages.VAL_KILRATE : Messages.VAL_KILB;
var result = Math.Round(bytes / BINARY_KILO, decPlaces);
return string.IsNullOrEmpty(format) ? result.ToString() : result.ToString(format);
}
unit = isRate ? Messages.VAL_RATE : Messages.VAL_BYTE;
return bytes.ToString();
}

@borzel

This comment has been minimized.

Copy link
Member Author

@borzel borzel commented May 21, 2019

First little Test: MBps -> MBit/s

grafik

Code (modified MBps and GBps):

private static string ByteSizeString(double bytes, int decPlaces, bool isRate, out string unit, string format = null)
        {
            if (bytes >= BINARY_TERA)
            {
                unit = isRate ? Messages.VAL_TERRATE : Messages.VAL_TERB;
                var result = Math.Round(bytes / BINARY_TERA, decPlaces);
                return string.IsNullOrEmpty(format) ? result.ToString() : result.ToString(format);
            }
            if (bytes >= BINARY_GIGA)
            {
                unit = isRate ? "GBit/s" /*Messages.VAL_GIGRATE*/ : Messages.VAL_GIGB;
                var result = isRate ? Math.Round((bytes*8) / (BINARY_GIGA), decPlaces) : Math.Round(bytes / BINARY_GIGA, decPlaces);
                return string.IsNullOrEmpty(format) ? result.ToString() : result.ToString(format);
            }

            if (bytes >= BINARY_MEGA)
            {
                unit = isRate ? "MBit/s" /*Messages.VAL_MEGRATE*/ : Messages.VAL_MEGB;
                var result = isRate ? Math.Round((bytes*8) / (BINARY_MEGA), decPlaces) : Math.Round(bytes / BINARY_MEGA, decPlaces);
                return string.IsNullOrEmpty(format) ? result.ToString() : result.ToString(format);
            }

            if (bytes >= BINARY_KILO)
            {
                unit = isRate ? Messages.VAL_KILRATE : Messages.VAL_KILB;
                var result = Math.Round(bytes / BINARY_KILO, decPlaces);
                return string.IsNullOrEmpty(format) ? result.ToString() : result.ToString(format);
            }

            unit = isRate ? Messages.VAL_RATE : Messages.VAL_BYTE;
            return bytes.ToString();
        }
@borzel

This comment has been minimized.

Copy link
Member Author

@borzel borzel commented May 25, 2019

Here my idea:

  • use Bit/s, KBit/s, MBit/s, GBit/s, TBit/s for Network
  • use Byte/s, KByte/s, MByte/s, GByte/s, TByte/s instead of Bps, kBps, MBps, GBps, TBps

grafik

@Gatak

This comment has been minimized.

Copy link

@Gatak Gatak commented May 28, 2019

I would suggest be more clear and use KiB and Kibit and equivalent. There's a difference between base 10 and binary numbers.

https://sv.m.wikipedia.org/wiki/Mall:Multipler_av_byte
https://en.m.wikipedia.org/wiki/Template:Bit_and_byte_prefixes

Kilobyte, kB = 10^3 = 1000 bytes
Kibibyte, KiB = 2^10 = 1024 bytes

KiB is what most people mean when talking KB, but there are exceptions. Storage manufacturers usually use the SI units, which is 10^x.

@borzel

This comment has been minimized.

Copy link
Member Author

@borzel borzel commented May 28, 2019

I'm everytime confused with that KiBit ... it's about digital data, so why should someone think in 1000 for K?

I think KBit and KByte is clear enough in our context.

@sza-mot

This comment has been minimized.

Copy link

@sza-mot sza-mot commented May 31, 2019

I like the idea.
But the correct name for bit is bit, not Bit.
Well, the correct name for byte is byte, not Byte, but Byte is better "visible" and matches the unit symbol, so I'm OK with Byte.

https://en.wikipedia.org/wiki/Bit:

The symbol for the binary digit is either simply bit per recommendation by the IEC 80000-13:2008 standard, or the lowercase character b, as recommended by the IEEE 1541-2002 and IEEE Std 260.1-2004 standards.

https://en.wikipedia.org/wiki/Byte#Unit_symbol:

The unit symbol for the byte is specified in IEC 80000-13, IEEE 1541 and the Metric Interchange Format[9] as the upper-case character B. In contrast, IEEE 1541 specifies the lower case character b as the symbol for the bit, but IEC 80000-13 and Metric-Interchange-Format specify the symbol as bit, providing disambiguation from B for byte.

(bolding by me).

@borzel borzel modified the milestones: 8.0.1, 8.0.2 Jul 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.