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
1f26a946
Commit
1f26a946
authored
Sep 28, 2015
by
antirez
Browse files
Lazyfree: pending objects count in INFO output.
parent
c69c6c80
Changes
3
Show whitespace changes
Inline
Side-by-side
src/lazyfree.c
View file @
1f26a946
...
@@ -6,6 +6,11 @@
...
@@ -6,6 +6,11 @@
static
size_t
lazyfree_objects
=
0
;
static
size_t
lazyfree_objects
=
0
;
pthread_mutex_t
lazyfree_objects_mutex
=
PTHREAD_MUTEX_INITIALIZER
;
pthread_mutex_t
lazyfree_objects_mutex
=
PTHREAD_MUTEX_INITIALIZER
;
/* Return the number of currently pending objects to free. */
size_t
lazyfreeGetPendingObjectsCount
(
void
)
{
return
lazyfree_objects
;
}
/* Return the amount of work needed in order to free an object.
/* Return the amount of work needed in order to free an object.
* The return value is not always the actual number of allocations the
* The return value is not always the actual number of allocations the
* object is compoesd of, but a number proportional to it.
* object is compoesd of, but a number proportional to it.
...
...
src/server.c
View file @
1f26a946
...
@@ -2803,7 +2803,8 @@ sds genRedisInfoString(char *section) {
...
@@ -2803,7 +2803,8 @@ sds genRedisInfoString(char *section) {
"maxmemory_human:%s
\r\n
"
"maxmemory_human:%s
\r\n
"
"maxmemory_policy:%s
\r\n
"
"maxmemory_policy:%s
\r\n
"
"mem_fragmentation_ratio:%.2f
\r\n
"
"mem_fragmentation_ratio:%.2f
\r\n
"
"mem_allocator:%s
\r\n
"
,
"mem_allocator:%s
\r\n
"
"lazyfree_pending_objects:%zu
\r\n
"
,
zmalloc_used
,
zmalloc_used
,
hmem
,
hmem
,
server
.
resident_set_size
,
server
.
resident_set_size
,
...
@@ -2818,7 +2819,8 @@ sds genRedisInfoString(char *section) {
...
@@ -2818,7 +2819,8 @@ sds genRedisInfoString(char *section) {
maxmemory_hmem
,
maxmemory_hmem
,
evict_policy
,
evict_policy
,
zmalloc_get_fragmentation_ratio
(
server
.
resident_set_size
),
zmalloc_get_fragmentation_ratio
(
server
.
resident_set_size
),
ZMALLOC_LIB
ZMALLOC_LIB
,
lazyfreeGetPendingObjectsCount
()
);
);
}
}
...
...
src/server.h
View file @
1f26a946
...
@@ -1414,6 +1414,7 @@ void slotToKeyFlush(void);
...
@@ -1414,6 +1414,7 @@ void slotToKeyFlush(void);
int
dbAsyncDelete
(
redisDb
*
db
,
robj
*
key
);
int
dbAsyncDelete
(
redisDb
*
db
,
robj
*
key
);
void
emptyDbAsync
(
redisDb
*
db
);
void
emptyDbAsync
(
redisDb
*
db
);
void
slotToKeyFlushAsync
(
void
);
void
slotToKeyFlushAsync
(
void
);
size_t
lazyfreeGetPendingObjectsCount
(
void
);
/* API to get key arguments from commands */
/* API to get key arguments from commands */
int
*
getKeysFromCommand
(
struct
redisCommand
*
cmd
,
robj
**
argv
,
int
argc
,
int
*
numkeys
);
int
*
getKeysFromCommand
(
struct
redisCommand
*
cmd
,
robj
**
argv
,
int
argc
,
int
*
numkeys
);
...
...
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