To monitor a server we have imported a dashboard for Grafana. This uses Telegraf and InfluxDB as collector and database.
When certain graphs needed to be adjusted, I noticed that in the network speed queries, the bytes received (bytes_recv) are multiplied by 8, but the units on the graph itself are displayed in bits.
SELECT non_negative_derivative(mean(bytes_recv),1s)*8 as "in" FROM "net" WHERE host =~ /$server/ AND interface =~ /$netif/ AND $timeFilter GROUP BY time($interval), * fill(none)
According to my understanding is: 8Bit = 1Byte. According to this, if the data is available as bytes, it would have to be divided by 8 to get bits, if the graph should display bits.
Furthermore (if I am not mistaken): Megabit = Mb Mebibit = Mib Megabyte = MB Mebibyte = MiB
Refering to this, the unit on the graph seems to be megabit right? Do I understand something fundamentally wrong or was the "*" simply confused with the "/"?
Sorry, your math is slightly incorrect.
1 byte = 8 bits
. So far, so good. Given that, a byte is bigger than a bit (specifically eight times bigger). We know this because it takes eight bits to consume the same space a byte would. So we can re-write the equation as1 byte = 8 * 1 bit
. Or, alternately,1 bit = ⅛ byte
. So, if we have, say,X bytes
, but we want bits, we multiply by8
, giving us the equationbytes * 8 = bits
. As a general rule, if you go from a big unit of measurement to a smaller one (like bytes to bits), you multiply.