Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
8d617596
Commit
8d617596
authored
Jul 19, 2018
by
antirez
Browse files
Implement a function to retrieve the expansive clients mem usage.
parent
85a1b4f8
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/server.c
View file @
8d617596
...
...
@@ -920,6 +920,18 @@ int clientsCronTrackExpansiveClients(client *c) {
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
void
clientsCron
(
void
)
{
/* Make sure to process at least numclients/server.hz of clients
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment