mirror of
https://github.com/akvorado/akvorado.git
synced 2025-12-11 22:14:02 +01:00
console: fix calculation of the L2 overhead when selecting L2 bps
This commit is contained in:
@@ -190,7 +190,12 @@ func (c *Component) contextFunc(inputStr string) context {
|
||||
case "l3bps":
|
||||
units = `SUM(Bytes*SamplingRate*8)`
|
||||
case "l2bps":
|
||||
units = `SUM((Bytes+18*Packets)*SamplingRate*8)`
|
||||
// For each packet, we add the Ethernet header (14 bytes), the CRC (4
|
||||
// bytes), the preamble and start frame delimiter (8 bytes) and the IPG
|
||||
// (~ 12 bytes). We don't include the VLAN header (4 bytes) as it is
|
||||
// often not used with external entities. Both sFlow and IPFIX may have
|
||||
// a better view of that, but we don't collect it yet.
|
||||
units = `SUM((Bytes+38*Packets)*SamplingRate*8)`
|
||||
}
|
||||
|
||||
c.metrics.clickhouseQueries.WithLabelValues(table).Inc()
|
||||
|
||||
Reference in New Issue
Block a user