Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Turbo码先生
redis
提交
758b39be
R
redis
项目概览
Turbo码先生
/
redis
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
redis
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
758b39be
编写于
10月 02, 2019
作者:
A
antirez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Speedup INFO server section.
上级
f49f0a6f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
32 addition
and
17 deletion
+32
-17
src/release.c
src/release.c
+14
-0
src/server.c
src/server.c
+17
-17
src/server.h
src/server.h
+1
-0
未找到文件。
src/release.c
浏览文件 @
758b39be
...
...
@@ -32,6 +32,7 @@
* files using this functions. */
#include <string.h>
#include <stdio.h>
#include "release.h"
#include "version.h"
...
...
@@ -50,3 +51,16 @@ uint64_t redisBuildId(void) {
return
crc64
(
0
,(
unsigned
char
*
)
buildid
,
strlen
(
buildid
));
}
/* Return a cached value of the build string in order to avoid recomputing
* and converting it in hex every time: this string is shown in the INFO
* output that should be fast. */
char
*
redisBuildIdString
(
void
)
{
static
char
buf
[
32
];
static
int
cached
=
0
;
if
(
!
cached
)
{
snprintf
(
buf
,
sizeof
(
buf
),
"%llx"
,(
unsigned
long
long
)
redisBuildId
());
cached
=
1
;
}
return
buf
;
}
src/server.c
浏览文件 @
758b39be
...
...
@@ -3892,32 +3892,32 @@ sds genRedisInfoString(char *section) {
call_uname
=
0
;
}
info
=
sdscat
printf
(
info
,
info
=
sdscat
fmt
(
info
,
"# Server
\r\n
"
"redis_version:%s
\r\n
"
"redis_git_sha1:%s
\r\n
"
"redis_git_dirty:%
d
\r\n
"
"redis_build_id:%
llx
\r\n
"
"redis_git_dirty:%
i
\r\n
"
"redis_build_id:%
s
\r\n
"
"redis_mode:%s
\r\n
"
"os:%s %s %s
\r\n
"
"arch_bits:%
d
\r\n
"
"arch_bits:%
i
\r\n
"
"multiplexing_api:%s
\r\n
"
"atomicvar_api:%s
\r\n
"
"gcc_version:%
d.%d.%d
\r\n
"
"process_id:%
ld
\r\n
"
"gcc_version:%
i.%i.%i
\r\n
"
"process_id:%
I
\r\n
"
"run_id:%s
\r\n
"
"tcp_port:%
d
\r\n
"
"uptime_in_seconds:%
jd
\r\n
"
"uptime_in_days:%
jd
\r\n
"
"hz:%
d
\r\n
"
"configured_hz:%
d
\r\n
"
"lru_clock:%
ld
\r\n
"
"tcp_port:%
i
\r\n
"
"uptime_in_seconds:%
I
\r\n
"
"uptime_in_days:%
I
\r\n
"
"hz:%
i
\r\n
"
"configured_hz:%
i
\r\n
"
"lru_clock:%
u
\r\n
"
"executable:%s
\r\n
"
"config_file:%s
\r\n
"
,
REDIS_VERSION
,
redisGitSHA1
(),
strtol
(
redisGitDirty
(),
NULL
,
10
)
>
0
,
(
unsigned
long
long
)
redisBuildId
(),
redisBuildIdString
(),
mode
,
name
.
sysname
,
name
.
release
,
name
.
machine
,
server
.
arch_bits
,
...
...
@@ -3928,14 +3928,14 @@ sds genRedisInfoString(char *section) {
#else
0
,
0
,
0
,
#endif
(
long
)
getpid
(),
(
int64_t
)
getpid
(),
server
.
runid
,
server
.
port
,
(
int
max
_t
)
uptime
,
(
int
max
_t
)(
uptime
/
(
3600
*
24
)),
(
int
64
_t
)
uptime
,
(
int
64
_t
)(
uptime
/
(
3600
*
24
)),
server
.
hz
,
server
.
config_hz
,
(
unsigned
long
)
server
.
lruclock
,
server
.
lruclock
,
server
.
executable
?
server
.
executable
:
""
,
server
.
configfile
?
server
.
configfile
:
""
);
}
...
...
src/server.h
浏览文件 @
758b39be
...
...
@@ -2140,6 +2140,7 @@ void dictSdsDestructor(void *privdata, void *val);
char
*
redisGitSHA1
(
void
);
char
*
redisGitDirty
(
void
);
uint64_t
redisBuildId
(
void
);
char
*
redisBuildIdString
(
void
);
/* Commands prototypes */
void
authCommand
(
client
*
c
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录