ifdefs added to use kevent on Free Open and Net BSD as well. INFO and ae.c modified in order to report the multiplexing API in use
This commit is contained in:
parent
1751139117
commit
7a932b74cc
7
ae.c
7
ae.c
@ -373,9 +373,12 @@ int aeWait(int fd, int mask, long long milliseconds) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void aeMain(aeEventLoop *eventLoop)
|
void aeMain(aeEventLoop *eventLoop) {
|
||||||
{
|
|
||||||
eventLoop->stop = 0;
|
eventLoop->stop = 0;
|
||||||
while (!eventLoop->stop)
|
while (!eventLoop->stop)
|
||||||
aeProcessEvents(eventLoop, AE_ALL_EVENTS);
|
aeProcessEvents(eventLoop, AE_ALL_EVENTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *aeGetApiName(void) {
|
||||||
|
return aeApiName();
|
||||||
|
}
|
||||||
|
1
ae.h
1
ae.h
@ -111,5 +111,6 @@ int aeDeleteTimeEvent(aeEventLoop *eventLoop, long long id);
|
|||||||
int aeProcessEvents(aeEventLoop *eventLoop, int flags);
|
int aeProcessEvents(aeEventLoop *eventLoop, int flags);
|
||||||
int aeWait(int fd, int mask, long long milliseconds);
|
int aeWait(int fd, int mask, long long milliseconds);
|
||||||
void aeMain(aeEventLoop *eventLoop);
|
void aeMain(aeEventLoop *eventLoop);
|
||||||
|
char *aeGetApiName(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -85,3 +85,7 @@ static int aeApiPoll(aeEventLoop *eventLoop, struct timeval *tvp) {
|
|||||||
}
|
}
|
||||||
return numevents;
|
return numevents;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static char *aeApiName(void) {
|
||||||
|
return "epoll";
|
||||||
|
}
|
||||||
|
@ -87,3 +87,7 @@ static int aeApiPoll(aeEventLoop *eventLoop, struct timeval *tvp) {
|
|||||||
}
|
}
|
||||||
return numevents;
|
return numevents;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static char *aeApiName(void) {
|
||||||
|
return "kqueue";
|
||||||
|
}
|
||||||
|
@ -72,3 +72,7 @@ static int aeApiPoll(aeEventLoop *eventLoop, struct timeval *tvp) {
|
|||||||
}
|
}
|
||||||
return numevents;
|
return numevents;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static char *aeApiName(void) {
|
||||||
|
return "select";
|
||||||
|
}
|
||||||
|
2
config.h
2
config.h
@ -31,7 +31,7 @@
|
|||||||
#define HAVE_EPOLL 1
|
#define HAVE_EPOLL 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined (__NetBSD__)
|
||||||
#define HAVE_KQUEUE 1
|
#define HAVE_KQUEUE 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
2
redis.c
2
redis.c
@ -5018,6 +5018,7 @@ static void infoCommand(redisClient *c) {
|
|||||||
info = sdscatprintf(sdsempty(),
|
info = sdscatprintf(sdsempty(),
|
||||||
"redis_version:%s\r\n"
|
"redis_version:%s\r\n"
|
||||||
"arch_bits:%s\r\n"
|
"arch_bits:%s\r\n"
|
||||||
|
"multiplexing_api:%s\r\n"
|
||||||
"uptime_in_seconds:%d\r\n"
|
"uptime_in_seconds:%d\r\n"
|
||||||
"uptime_in_days:%d\r\n"
|
"uptime_in_days:%d\r\n"
|
||||||
"connected_clients:%d\r\n"
|
"connected_clients:%d\r\n"
|
||||||
@ -5031,6 +5032,7 @@ static void infoCommand(redisClient *c) {
|
|||||||
"role:%s\r\n"
|
"role:%s\r\n"
|
||||||
,REDIS_VERSION,
|
,REDIS_VERSION,
|
||||||
(sizeof(long) == 8) ? "64" : "32",
|
(sizeof(long) == 8) ? "64" : "32",
|
||||||
|
aeGetApiName(),
|
||||||
uptime,
|
uptime,
|
||||||
uptime/(3600*24),
|
uptime/(3600*24),
|
||||||
listLength(server.clients)-listLength(server.slaves),
|
listLength(server.clients)-listLength(server.slaves),
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
# TODO # test pipelining
|
# test-redis.tcl
|
||||||
|
# Redis test suite. Copyright (C) 2009 Salvatore Sanfilippo antirez@gmail.com
|
||||||
|
# This softare is released under the BSD License. See the COPYING file for
|
||||||
|
# more information.
|
||||||
|
|
||||||
set tcl_precision 17
|
set tcl_precision 17
|
||||||
source redis.tcl
|
source redis.tcl
|
||||||
|
Loading…
x
Reference in New Issue
Block a user