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
e3ff4145
Unverified
Commit
e3ff4145
authored
Dec 13, 2020
by
Wang Yuan
Committed by
GitHub
Dec 13, 2020
Browse files
Add total_forks to INFO STATS (#8155)
parent
63c1303c
Changes
2
Show whitespace changes
Inline
Side-by-side
src/server.c
View file @
e3ff4145
...
...
@@ -2925,6 +2925,7 @@ void resetServerStats(void) {
server
.
stat_active_defrag_scanned
=
0
;
server
.
stat_fork_time
=
0
;
server
.
stat_fork_rate
=
0
;
server
.
stat_total_forks
=
0
;
server
.
stat_rejected_conn
=
0
;
server
.
stat_sync_full
=
0
;
server
.
stat_sync_partial_ok
=
0
;
...
...
@@ -4654,6 +4655,7 @@ sds genRedisInfoString(const char *section) {
"pubsub_channels:%ld
\r\n
"
"pubsub_patterns:%lu
\r\n
"
"latest_fork_usec:%lld
\r\n
"
"total_forks:%lld
\r\n
"
"migrate_cached_sockets:%ld
\r\n
"
"slave_expires_tracked_keys:%zu
\r\n
"
"active_defrag_hits:%lld
\r\n
"
...
...
@@ -4690,6 +4692,7 @@ sds genRedisInfoString(const char *section) {
dictSize
(
server
.
pubsub_channels
),
listLength
(
server
.
pubsub_patterns
),
server
.
stat_fork_time
,
server
.
stat_total_forks
,
dictSize
(
server
.
migrate_cached_sockets
),
getSlaveKeyWithExpireCount
(),
server
.
stat_active_defrag_hits
,
...
...
@@ -5188,6 +5191,7 @@ int redisFork(int purpose) {
closeClildUnusedResourceAfterFork
();
}
else
{
/* Parent */
server
.
stat_total_forks
++
;
server
.
stat_fork_time
=
ustime
()
-
start
;
server
.
stat_fork_rate
=
(
double
)
zmalloc_used_memory
()
*
1000000
/
server
.
stat_fork_time
/
(
1024
*
1024
*
1024
);
/* GB per second. */
latencyAddSampleIfNeeded
(
"fork"
,
server
.
stat_fork_time
/
1000
);
...
...
src/server.h
View file @
e3ff4145
...
...
@@ -1215,6 +1215,7 @@ struct redisServer {
size_t
stat_peak_memory
;
/* Max used memory record */
long
long
stat_fork_time
;
/* Time needed to perform latest fork() */
double
stat_fork_rate
;
/* Fork rate in GB/sec. */
long
long
stat_total_forks
;
/* Total count of fork. */
long
long
stat_rejected_conn
;
/* Clients rejected because of maxclients */
long
long
stat_sync_full
;
/* Number of full resyncs with slaves. */
long
long
stat_sync_partial_ok
;
/* Number of accepted PSYNC requests. */
...
...
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