Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
1e394b73
Commit
1e394b73
authored
Jul 25, 2018
by
Pavel Rochnyack
Committed by
antirez
Jul 30, 2018
Browse files
INFO CPU: higher precision of reported values
Closes: #5033
parent
1465755e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/server.c
View file @
1e394b73
...
...
@@ -3536,14 +3536,14 @@ sds genRedisInfoString(char *section) {
if
(
sections
++
)
info
=
sdscat
(
info
,
"
\r\n
"
);
info
=
sdscatprintf
(
info
,
"# CPU
\r\n
"
"used_cpu_sys:%
.2f
\r\n
"
"used_cpu_user:%
.2f
\r\n
"
"used_cpu_sys_children:%
.2f
\r\n
"
"used_cpu_user_children:%
.2f
\r\n
"
,
(
f
lo
at
)
self_ru
.
ru_stime
.
tv_sec
+
(
float
)
self_ru
.
ru_stime
.
tv_usec
/
1000000
,
(
f
lo
at
)
self_ru
.
ru_utime
.
tv_sec
+
(
float
)
self_ru
.
ru_utime
.
tv_usec
/
1000000
,
(
f
lo
at
)
c_ru
.
ru_stime
.
tv_sec
+
(
float
)
c_ru
.
ru_stime
.
tv_usec
/
1000000
,
(
f
lo
at
)
c_ru
.
ru_utime
.
tv_sec
+
(
float
)
c_ru
.
ru_utime
.
tv_usec
/
1000000
);
"used_cpu_sys:%
ld.%06ld
\r\n
"
"used_cpu_user:%
ld.%06ld
\r\n
"
"used_cpu_sys_children:%
ld.%06ld
\r\n
"
"used_cpu_user_children:%
ld.%06ld
\r\n
"
,
(
lo
ng
)
self_ru
.
ru_stime
.
tv_sec
,
(
long
)
self_ru
.
ru_stime
.
tv_usec
,
(
lo
ng
)
self_ru
.
ru_utime
.
tv_sec
,
(
long
)
self_ru
.
ru_utime
.
tv_usec
,
(
lo
ng
)
c_ru
.
ru_stime
.
tv_sec
,
(
long
)
c_ru
.
ru_stime
.
tv_usec
,
(
lo
ng
)
c_ru
.
ru_utime
.
tv_sec
,
(
long
)
c_ru
.
ru_utime
.
tv_usec
);
}
/* Command statistics */
...
...
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