mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 17:10:50 +00:00
Implement a function to retrieve the expansive clients mem usage.
This commit is contained in:
parent
85a1b4f807
commit
8d617596f1
12
src/server.c
12
src/server.c
@ -920,6 +920,18 @@ int clientsCronTrackExpansiveClients(client *c) {
|
|||||||
return 0; /* This function never terminates the client. */
|
return 0; /* This function never terminates the client. */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Return the max samples in the memory usage of clients tracked by
|
||||||
|
* the function clientsCronTrackExpansiveClients(). */
|
||||||
|
void getExpansiveClientsInfo(size_t *in_usage, size_t *out_usage) {
|
||||||
|
size_t i = 0, o = 0;
|
||||||
|
for (int j = 0; j < CLIENTS_PEAK_MEM_USAGE_SLOTS; j++) {
|
||||||
|
if (ClientsPeakMemInput[j] > i) i = ClientsPeakMemInput[j];
|
||||||
|
if (ClientsPeakMemOutput[j] > o) o = ClientsPeakMemOutput[o];
|
||||||
|
}
|
||||||
|
*in_usage = i;
|
||||||
|
*out_usage = o;
|
||||||
|
}
|
||||||
|
|
||||||
#define CLIENTS_CRON_MIN_ITERATIONS 5
|
#define CLIENTS_CRON_MIN_ITERATIONS 5
|
||||||
void clientsCron(void) {
|
void clientsCron(void) {
|
||||||
/* Make sure to process at least numclients/server.hz of clients
|
/* Make sure to process at least numclients/server.hz of clients
|
||||||
|
Loading…
x
Reference in New Issue
Block a user