MCPcopy
hub / github.com/grafana/dskit / addReceivedBytes

Method addReceivedBytes

kv/memberlist/tcp_transport_conn.go:89–94  ·  view source on GitHub ↗

addReceivedBytes adds bytes to the local received counter and flushes to Prometheus if threshold is reached.

(n int64)

Source from the content-addressed store, hash-verified

87
88// addReceivedBytes adds bytes to the local received counter and flushes to Prometheus if threshold is reached.
89func (c *meteredConn) addReceivedBytes(n int64) {
90 newTotal := c.receivedBytesLocal.Add(n)
91 if newTotal >= flushThreshold {
92 c.flush()
93 }
94}
95
96// flush flushes any remaining local byte counters to the Prometheus counters.
97func (c *meteredConn) flush() {

Callers 1

ReadMethod · 0.95

Calls 2

flushMethod · 0.95
AddMethod · 0.65

Tested by

no test coverage detected