Score:0

Why do the creators of this dashboard multiply bytes by 8 to get bits? Isn't it the other way around?

cn flag

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

in flag
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
JJandke avatar
cn flag
Thanks, you're right.
Score:0
br flag

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.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.