| 1914 | size_t ClientsPeakMemOutput[CLIENTS_PEAK_MEM_USAGE_SLOTS] = {0}; |
| 1915 | |
| 1916 | int 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 |
no test coverage detected