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
e74dca73
Commit
e74dca73
authored
Mar 13, 2012
by
antirez
Browse files
Client creation time in redisClient structure. New age field in CLIENT LIST output.
parent
57337380
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/networking.c
View file @
e74dca73
...
...
@@ -51,7 +51,7 @@ redisClient *createClient(int fd) {
c
->
bulklen
=
-
1
;
c
->
sentlen
=
0
;
c
->
flags
=
0
;
c
->
lastinteraction
=
time
(
NULL
);
c
->
ctime
=
c
->
lastinteraction
=
time
(
NULL
);
c
->
authenticated
=
0
;
c
->
replstate
=
REDIS_REPL_NONE
;
c
->
reply
=
listCreate
();
...
...
@@ -1111,8 +1111,9 @@ sds getClientInfoString(redisClient *client) {
if
(
emask
&
AE_WRITABLE
)
*
p
++
=
'w'
;
*
p
=
'\0'
;
return
sdscatprintf
(
sdsempty
(),
"addr=%s:%d fd=%d idle=%ld flags=%s db=%d sub=%d psub=%d qbuf=%lu obl=%lu oll=%lu omem=%lu events=%s cmd=%s"
,
"addr=%s:%d fd=%d
age=%ld
idle=%ld flags=%s db=%d sub=%d psub=%d qbuf=%lu obl=%lu oll=%lu omem=%lu events=%s cmd=%s"
,
ip
,
port
,
client
->
fd
,
(
long
)(
now
-
client
->
ctime
),
(
long
)(
now
-
client
->
lastinteraction
),
flags
,
client
->
db
->
id
,
...
...
src/redis.h
View file @
e74dca73
...
...
@@ -332,6 +332,7 @@ typedef struct redisClient {
list
*
reply
;
unsigned
long
reply_bytes
;
/* Tot bytes of objects in reply list */
int
sentlen
;
time_t
ctime
;
/* Client creation time */
time_t
lastinteraction
;
/* time of the last interaction, used for timeout */
time_t
obuf_soft_limit_reached_time
;
int
flags
;
/* REDIS_SLAVE | REDIS_MONITOR | REDIS_MULTI ... */
...
...
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