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

Method flush

kv/memberlist/tcp_transport_conn.go:97–104  ·  view source on GitHub ↗

flush flushes any remaining local byte counters to the Prometheus counters.

()

Source from the content-addressed store, hash-verified

95
96// flush flushes any remaining local byte counters to the Prometheus counters.
97func (c *meteredConn) flush() {
98 if sentBytes := c.sentBytesLocal.Swap(0); sentBytes > 0 {
99 c.sentBytesCounter.Add(float64(sentBytes))
100 }
101 if receivedBytes := c.receivedBytesLocal.Swap(0); receivedBytes > 0 {
102 c.receivedBytesCounter.Add(float64(receivedBytes))
103 }
104}

Callers 3

CloseMethod · 0.95
addSentBytesMethod · 0.95
addReceivedBytesMethod · 0.95

Calls 2

AddMethod · 0.65
SwapMethod · 0.45

Tested by

no test coverage detected