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

Function clientsCronTrackExpansiveClients

src/server.cpp:1916–1926  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1914size_t ClientsPeakMemOutput[CLIENTS_PEAK_MEM_USAGE_SLOTS] = {0};
1915
1916int clientsCronTrackExpansiveClients(client *c, int time_idx) {
1917 size_t in_usage = sdsZmallocSize(c->querybuf) + c->argv_len_sum() +
1918 (c->argv ? zmalloc_size(c->argv) : 0);
1919 size_t out_usage = getClientOutputBufferMemoryUsage(c);
1920
1921 /* Track the biggest values observed so far in this slot. */
1922 if (in_usage > ClientsPeakMemInput[time_idx]) ClientsPeakMemInput[time_idx] = in_usage;
1923 if (out_usage > ClientsPeakMemOutput[time_idx]) ClientsPeakMemOutput[time_idx] = out_usage;
1924
1925 return 0; /* This function never terminates the client. */
1926}
1927
1928/* Iterating all the clients in getMemoryOverheadData() is too slow and
1929 * in turn would make the INFO command too slow. So we perform this

Callers 1

clientsCronFunction · 0.85

Calls 4

sdsZmallocSizeFunction · 0.85
zmalloc_sizeFunction · 0.85
argv_len_sumMethod · 0.80

Tested by

no test coverage detected