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

Function newMeteredConn

kv/memberlist/tcp_transport_conn.go:33–39  ·  view source on GitHub ↗

newMeteredConn creates a new metered connection wrapper.

(conn net.Conn, sentBytes, receivedBytes prometheus.Counter)

Source from the content-addressed store, hash-verified

31
32// newMeteredConn creates a new metered connection wrapper.
33func newMeteredConn(conn net.Conn, sentBytes, receivedBytes prometheus.Counter) *meteredConn {
34 return &meteredConn{
35 Conn: conn,
36 sentBytesCounter: sentBytes,
37 receivedBytesCounter: receivedBytes,
38 }
39}
40
41// Read implement net.Conn.
42func (c *meteredConn) Read(b []byte) (n int, err error) {

Callers 2

handleConnectionMethod · 0.85
getConnectionMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected