Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
Incubator Pegasus
提交
25d68778
Incubator Pegasus
项目概览
apache
/
Incubator Pegasus
通知
9
Star
5
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Incubator Pegasus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
25d68778
编写于
1月 07, 2019
作者:
L
Lai Yingchun
提交者:
QinZuoyan
1月 07, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
monitor: fix hit rate monitor bug for falcon (#246)
上级
494acd58
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
48 addition
and
34 deletion
+48
-34
scripts/falcon_screen.json
scripts/falcon_screen.json
+10
-0
src/server/info_collector.cpp
src/server/info_collector.cpp
+37
-33
src/shell/commands.h
src/shell/commands.h
+1
-1
未找到文件。
scripts/falcon_screen.json
浏览文件 @
25d68778
...
...
@@ -169,6 +169,16 @@
"method"
:
""
,
"timespan"
:
86400
},
{
"title"
:
"rocksdb缓存命中率(统计各表的rocksdb block cache命中率;单位:百分比*10000;1M表示100%)"
,
"endpoints"
:
[
"cluster=${cluster.name} job=collector service=pegasus"
],
"counters"
:
[
"collector*app.pegasus*app.stat.rdb_block_cache_hit_rate#${for.each.table}/cluster=${cluster.name},job=collector,port=${collector.port},service=pegasus"
],
"graph_type"
:
"a"
,
"method"
:
""
,
"timespan"
:
86400
},
{
"title"
:
"各节点SharedLog大小(单位:MB)"
,
"endpoints"
:
[
"cluster=${cluster.name} job=replica service=pegasus"
],
...
...
src/server/info_collector.cpp
浏览文件 @
25d68778
...
...
@@ -35,8 +35,7 @@ info_collector::info_collector()
_meta_servers
.
group_address
()
->
add
(
ms
);
}
_cluster_name
=
dsn_config_get_value_string
(
"pegasus.collector"
,
"cluster"
,
""
,
"cluster name"
);
_cluster_name
=
dsn_config_get_value_string
(
"pegasus.collector"
,
"cluster"
,
""
,
"cluster name"
);
dassert
(
_cluster_name
.
size
()
>
0
,
""
);
_shell_context
.
current_cluster_name
=
_cluster_name
;
...
...
@@ -136,8 +135,10 @@ void info_collector::on_app_stat()
row
.
recent_write_throttling_reject_count
);
counters
->
storage_mb
->
set
(
row
.
storage_mb
);
counters
->
storage_count
->
set
(
row
.
storage_count
);
counters
->
rdb_block_cache_hit_rate
->
set
(
row
.
rdb_block_cache_hit_count
/
row
.
rdb_block_cache_total_count
);
counters
->
rdb_block_cache_hit_rate
->
set
(
std
::
abs
(
row
.
rdb_block_cache_total_count
)
<
1e-6
?
0
:
row
.
rdb_block_cache_hit_count
/
row
.
rdb_block_cache_total_count
*
1000000
);
counters
->
rdb_block_cache_mem_usage
->
set
(
row
.
rdb_block_cache_mem_usage
);
counters
->
rdb_index_and_filter_blocks_mem_usage
->
set
(
row
.
rdb_index_and_filter_blocks_mem_usage
);
...
...
@@ -162,37 +163,40 @@ info_collector::AppStatCounters *info_collector::get_app_counters(const std::str
return
find
->
second
;
}
AppStatCounters
*
counters
=
new
AppStatCounters
();
char
buf1
[
1024
];
char
buf2
[
1024
];
#define INIT_COUNER(type) \
char
counter_name
[
1024
];
char
counter_desc
[
1024
];
#define INIT_COUNTER(name) \
do { \
sprintf(buf1, "app.stat." #type "#%s", app_name.c_str()); \
sprintf(buf2, "statistic the " #type " of app %s", app_name.c_str()); \
counters->type.init_app_counter("app.pegasus", buf1, COUNTER_TYPE_NUMBER, buf2); \
sprintf(counter_name, "app.stat." #name "#%s", app_name.c_str()); \
sprintf(counter_desc, "statistic the " #name " of app %s", app_name.c_str()); \
counters->name.init_app_counter( \
"app.pegasus", counter_name, COUNTER_TYPE_NUMBER, counter_desc); \
} while (0)
INIT_COUNER
(
get_qps
);
INIT_COUNER
(
multi_get_qps
);
INIT_COUNER
(
put_qps
);
INIT_COUNER
(
multi_put_qps
);
INIT_COUNER
(
remove_qps
);
INIT_COUNER
(
multi_remove_qps
);
INIT_COUNER
(
incr_qps
);
INIT_COUNER
(
check_and_set_qps
);
INIT_COUNER
(
check_and_mutate_qps
);
INIT_COUNER
(
scan_qps
);
INIT_COUNER
(
recent_expire_count
);
INIT_COUNER
(
recent_filter_count
);
INIT_COUNER
(
recent_abnormal_count
);
INIT_COUNER
(
recent_write_throttling_delay_count
);
INIT_COUNER
(
recent_write_throttling_reject_count
);
INIT_COUNER
(
storage_mb
);
INIT_COUNER
(
storage_count
);
INIT_COUNER
(
rdb_block_cache_hit_rate
);
INIT_COUNER
(
rdb_block_cache_mem_usage
);
INIT_COUNER
(
rdb_index_and_filter_blocks_mem_usage
);
INIT_COUNER
(
rdb_memtable_mem_usage
);
INIT_COUNER
(
read_qps
);
INIT_COUNER
(
write_qps
);
INIT_COUNTER
(
get_qps
);
INIT_COUNTER
(
multi_get_qps
);
INIT_COUNTER
(
put_qps
);
INIT_COUNTER
(
multi_put_qps
);
INIT_COUNTER
(
remove_qps
);
INIT_COUNTER
(
multi_remove_qps
);
INIT_COUNTER
(
incr_qps
);
INIT_COUNTER
(
check_and_set_qps
);
INIT_COUNTER
(
check_and_mutate_qps
);
INIT_COUNTER
(
scan_qps
);
INIT_COUNTER
(
recent_expire_count
);
INIT_COUNTER
(
recent_filter_count
);
INIT_COUNTER
(
recent_abnormal_count
);
INIT_COUNTER
(
recent_write_throttling_delay_count
);
INIT_COUNTER
(
recent_write_throttling_reject_count
);
INIT_COUNTER
(
storage_mb
);
INIT_COUNTER
(
storage_count
);
INIT_COUNTER
(
rdb_block_cache_hit_rate
);
INIT_COUNTER
(
rdb_block_cache_mem_usage
);
INIT_COUNTER
(
rdb_index_and_filter_blocks_mem_usage
);
INIT_COUNTER
(
rdb_memtable_mem_usage
);
INIT_COUNTER
(
read_qps
);
INIT_COUNTER
(
write_qps
);
_app_stat_counters
[
app_name
]
=
counters
;
return
counters
;
}
...
...
src/shell/commands.h
浏览文件 @
25d68778
...
...
@@ -3721,7 +3721,7 @@ inline bool app_stat(command_executor *e, shell_context *sc, arguments args)
tp
.
append_data
(
row
.
storage_mb
);
tp
.
append_data
((
uint64_t
)
row
.
storage_count
);
double
block_cache_hit_rate
=
abs
(
row
.
rdb_block_cache_total_count
)
<
1e-6
std
::
abs
(
row
.
rdb_block_cache_total_count
)
<
1e-6
?
0.0
:
row
.
rdb_block_cache_hit_count
/
row
.
rdb_block_cache_total_count
;
tp
.
append_data
(
block_cache_hit_rate
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录