INFO now contains the time (in usecs) needed to fork() in order to persist. The info is available in the stats section of INFO.

This commit is contained in:
antirez
2011-05-29 15:17:29 +02:00
parent 43222f253a
commit 615e414c5d
4 changed files with 13 additions and 3 deletions

View File

@ -482,6 +482,7 @@ werr:
int rdbSaveBackground(char *filename) {
pid_t childpid;
long long start;
if (server.bgsavechildpid != -1 ||
server.bgsavethread != (pthread_t) -1) return REDIS_ERR;
@ -493,6 +494,7 @@ int rdbSaveBackground(char *filename) {
return dsRdbSaveBackground(filename);
}
start = ustime();
if ((childpid = fork()) == 0) {
int retval;
@ -503,6 +505,7 @@ int rdbSaveBackground(char *filename) {
_exit((retval == REDIS_OK) ? 0 : 1);
} else {
/* Parent */
server.stat_fork_time = ustime()-start;
if (childpid == -1) {
redisLog(REDIS_WARNING,"Can't save in background: fork: %s",
strerror(errno));