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

Function getExpansiveClientsInfo

src/server.cpp:1954–1962  ·  view source on GitHub ↗

Return the max samples in the memory usage of clients tracked by * the function clientsCronTrackExpansiveClients(). */

Source from the content-addressed store, hash-verified

1952/* Return the max samples in the memory usage of clients tracked by
1953 * the function clientsCronTrackExpansiveClients(). */
1954void getExpansiveClientsInfo(size_t *in_usage, size_t *out_usage) {
1955 size_t i = 0, o = 0;
1956 for (int j = 0; j < CLIENTS_PEAK_MEM_USAGE_SLOTS; j++) {
1957 if (ClientsPeakMemInput[j] > i) i = ClientsPeakMemInput[j];
1958 if (ClientsPeakMemOutput[j] > o) o = ClientsPeakMemOutput[j];
1959 }
1960 *in_usage = i;
1961 *out_usage = o;
1962}
1963
1964int closeClientOnOverload(client *c) {
1965 if (g_pserver->overload_closed_clients > MAX_CLIENTS_SHED_PER_PERIOD) return false;

Callers 1

genRedisInfoStringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected