0

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 "/"?

Screenshot of the Grafana Dashboard

JJandke
  • 3
  • 1
  • 1
    You are correct 1 byte = 8 bit. Just look at the values of 1 and 8 and then try your divide approach to get from byte to bits, you will recognize that you will fail to do so: 1/8 is not 8 – Robert Dec 08 '21 at 22:02
  • Thanks, you're right. – JJandke Dec 09 '21 at 15:31

1 Answers1

0

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 as 1 byte = 8 * 1 bit. Or, alternately, 1 bit = ⅛ byte. So, if we have, say, X bytes, but we want bits, we multiply by 8, giving us the equation bytes * 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.

cocomac
  • 116
  • 3