addSentBytes adds bytes to the local sent counter and flushes to Prometheus if threshold is reached.
(n int64)
| 79 | |
| 80 | // addSentBytes adds bytes to the local sent counter and flushes to Prometheus if threshold is reached. |
| 81 | func (c *meteredConn) addSentBytes(n int64) { |
| 82 | newTotal := c.sentBytesLocal.Add(n) |
| 83 | if newTotal >= flushThreshold { |
| 84 | c.flush() |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | // addReceivedBytes adds bytes to the local received counter and flushes to Prometheus if threshold is reached. |
| 89 | func (c *meteredConn) addReceivedBytes(n int64) { |