MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / getClusterConnectionsCount

Function getClusterConnectionsCount

src/cluster.cpp:770–776  ·  view source on GitHub ↗

Return the approximated number of sockets we are using in order to * take the cluster bus connections. */

Source from the content-addressed store, hash-verified

768/* Return the approximated number of sockets we are using in order to
769 * take the cluster bus connections. */
770unsigned long getClusterConnectionsCount(void) {
771 /* We decrement the number of nodes by one, since there is the
772 * "myself" node too in the list. Each node uses two file descriptors,
773 * one incoming and one outgoing, thus the multiplication by 2. */
774 return g_pserver->cluster_enabled && g_pserver->cluster != nullptr ?
775 ((dictSize(g_pserver->cluster->nodes)-1)*2) : 0;
776}
777
778/* -----------------------------------------------------------------------------
779 * Key space handling

Callers 2

genRedisInfoStringFunction · 0.85
acceptCommonHandlerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected