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
8f7e496b
Commit
8f7e496b
authored
Jul 19, 2018
by
antirez
Browse files
Rename var in clientsCronTrackExpansiveClients() for clarity.
parent
8d617596
Changes
1
Show whitespace changes
Inline
Side-by-side
src/server.c
View file @
8f7e496b
...
@@ -905,13 +905,13 @@ int clientsCronTrackExpansiveClients(client *c) {
...
@@ -905,13 +905,13 @@ int clientsCronTrackExpansiveClients(client *c) {
size_t
in_usage
=
sdsAllocSize
(
c
->
querybuf
);
size_t
in_usage
=
sdsAllocSize
(
c
->
querybuf
);
size_t
out_usage
=
getClientOutputBufferMemoryUsage
(
c
);
size_t
out_usage
=
getClientOutputBufferMemoryUsage
(
c
);
int
i
=
server
.
unixtime
%
CLIENTS_PEAK_MEM_USAGE_SLOTS
;
int
i
=
server
.
unixtime
%
CLIENTS_PEAK_MEM_USAGE_SLOTS
;
int
j
=
(
i
+
1
)
%
CLIENTS_PEAK_MEM_USAGE_SLOTS
;
int
zeroidx
=
(
i
+
1
)
%
CLIENTS_PEAK_MEM_USAGE_SLOTS
;
/* Always zero the next sample, so that when we switch to that second, we'll
/* Always zero the next sample, so that when we switch to that second, we'll
* only register samples that are greater in that second without considering
* only register samples that are greater in that second without considering
* the history of such slot. */
* the history of such slot. */
ClientsPeakMemInput
[
j
]
=
0
;
ClientsPeakMemInput
[
zeroidx
]
=
0
;
ClientsPeakMemOutput
[
j
]
=
0
;
ClientsPeakMemOutput
[
zeroidx
]
=
0
;
/* Track the biggest values observed so far in this slot. */
/* Track the biggest values observed so far in this slot. */
if
(
in_usage
>
ClientsPeakMemInput
[
i
])
ClientsPeakMemInput
[
i
]
=
in_usage
;
if
(
in_usage
>
ClientsPeakMemInput
[
i
])
ClientsPeakMemInput
[
i
]
=
in_usage
;
...
...
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