Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
hanoi2005
redis
提交
31f0a6ec
R
redis
项目概览
hanoi2005
/
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,发现更多精彩内容 >>
提交
31f0a6ec
编写于
2月 12, 2013
作者:
A
antirez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Replication: added new stats counting full and partial resynchronizations.
上级
5fe2577a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
29 addition
and
2 deletion
+29
-2
src/redis.c
src/redis.c
+9
-0
src/redis.h
src/redis.h
+3
-0
src/replication.c
src/replication.c
+17
-2
未找到文件。
src/redis.c
浏览文件 @
31f0a6ec
...
...
@@ -1350,6 +1350,9 @@ void initServer() {
server
.
stat_peak_memory
=
0
;
server
.
stat_fork_time
=
0
;
server
.
stat_rejected_conn
=
0
;
server
.
stat_sync_full
=
0
;
server
.
stat_sync_partial_ok
=
0
;
server
.
stat_sync_partial_err
=
0
;
memset
(
server
.
ops_sec_samples
,
0
,
sizeof
(
server
.
ops_sec_samples
));
server
.
ops_sec_idx
=
0
;
server
.
ops_sec_last_sample_time
=
mstime
();
...
...
@@ -2069,6 +2072,9 @@ sds genRedisInfoString(char *section) {
"total_commands_processed:%lld
\r\n
"
"instantaneous_ops_per_sec:%lld
\r\n
"
"rejected_connections:%lld
\r\n
"
"sync_full:%lld
\r\n
"
"sync_partial_ok:%lld
\r\n
"
"sync_partial_err:%lld
\r\n
"
"expired_keys:%lld
\r\n
"
"evicted_keys:%lld
\r\n
"
"keyspace_hits:%lld
\r\n
"
...
...
@@ -2080,6 +2086,9 @@ sds genRedisInfoString(char *section) {
server
.
stat_numcommands
,
getOperationsPerSecond
(),
server
.
stat_rejected_conn
,
server
.
stat_sync_full
,
server
.
stat_sync_partial_ok
,
server
.
stat_sync_partial_err
,
server
.
stat_expiredkeys
,
server
.
stat_evictedkeys
,
server
.
stat_keyspace_hits
,
...
...
src/redis.h
浏览文件 @
31f0a6ec
...
...
@@ -561,6 +561,9 @@ struct redisServer {
size_t
stat_peak_memory
;
/* Max used memory record */
long
long
stat_fork_time
;
/* Time needed to perform latest fork() */
long
long
stat_rejected_conn
;
/* Clients rejected because of maxclients */
long
long
stat_sync_full
;
/* Number of full resyncs with slaves. */
long
long
stat_sync_partial_ok
;
/* Number of accepted PSYNC requests. */
long
long
stat_sync_partial_err
;
/* Number of unaccepted PSYNC requests. */
list
*
slowlog
;
/* SLOWLOG list of commands */
long
long
slowlog_entry_id
;
/* SLOWLOG current entry ID */
long
long
slowlog_log_slower_than
;
/* SLOWLOG time limit (to get logged) */
...
...
src/replication.c
浏览文件 @
31f0a6ec
...
...
@@ -490,8 +490,23 @@ void syncCommand(redisClient *c) {
*
* So the slave knows the new runid and offset to try a PSYNC later
* if the connection with the master is lost. */
if
(
!
strcasecmp
(
c
->
argv
[
0
]
->
ptr
,
"psync"
)
&&
masterTryPartialResynchronization
(
c
)
==
REDIS_OK
)
return
;
if
(
!
strcasecmp
(
c
->
argv
[
0
]
->
ptr
,
"psync"
))
{
if
(
masterTryPartialResynchronization
(
c
)
==
REDIS_OK
)
{
server
.
stat_sync_partial_ok
++
;
return
;
/* No full resync needed, return. */
}
else
{
char
*
master_runid
=
c
->
argv
[
1
]
->
ptr
;
/* Increment stats for failed PSYNCs, but only if the
* runid is not "?", as this is used by slaves to force a full
* resync on purpose when they are not albe to partially
* resync. */
if
(
master_runid
[
0
]
!=
'?'
)
server
.
stat_sync_partial_err
++
;
}
}
/* Full resynchronization. */
server
.
stat_sync_full
++
;
/* Here we need to check if there is a background saving operation
* in progress, or if it is required to start one */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录