MCPcopy Create free account
hub / github.com/ContentSquare/chproxy / CurrentLoad

Method CurrentLoad

internal/topology/node.go:158–162  ·  view source on GitHub ↗

CurrentLoad returns the current node returns the number of open connections plus the penalty.

()

Source from the content-addressed store, hash-verified

156// CurrentLoad returns the current node returns the number of open connections
157// plus the penalty.
158func (n *Node) CurrentLoad() uint32 {
159 c := n.connections.Load()
160 p := n.penalty.Load()
161 return c + p
162}
163
164func (n *Node) CurrentConnections() uint32 {
165 return n.connections.Load()

Callers 7

TestPenalizeFunction · 0.95
StringMethod · 0.80
loadMethod · 0.80
getHostMethod · 0.80
TestRunningQueriesFunction · 0.80
TestGetHostFunction · 0.80

Calls 1

LoadMethod · 0.80

Tested by 4

TestPenalizeFunction · 0.76
TestRunningQueriesFunction · 0.64
TestGetHostFunction · 0.64