Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Metz
oceanbase
提交
0cb4c948
O
oceanbase
项目概览
Metz
/
oceanbase
与 Fork 源项目一致
Fork自
oceanbase / oceanbase
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oceanbase
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0cb4c948
编写于
6月 30, 2022
作者:
L
LINxiansheng
提交者:
wangzelin.wzl
6月 30, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
optimize the query response time performance
上级
29ee4001
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
5 addition
and
8 deletion
+5
-8
src/observer/mysql/ob_query_response_time.cpp
src/observer/mysql/ob_query_response_time.cpp
+5
-7
src/observer/mysql/ob_query_response_time.h
src/observer/mysql/ob_query_response_time.h
+0
-1
未找到文件。
src/observer/mysql/ob_query_response_time.cpp
浏览文件 @
0cb4c948
...
@@ -71,7 +71,7 @@ int ObRSTUtility::setup(uint base)
...
@@ -71,7 +71,7 @@ int ObRSTUtility::setup(uint base)
return
0
;
return
0
;
}
}
ObRSTTimeCollector
::
ObRSTTimeCollector
()
:
mutex_
()
ObRSTTimeCollector
::
ObRSTTimeCollector
()
{
{
flush
();
flush
();
}
}
...
@@ -81,8 +81,8 @@ ObRSTTimeCollector::~ObRSTTimeCollector()
...
@@ -81,8 +81,8 @@ ObRSTTimeCollector::~ObRSTTimeCollector()
int
ObRSTTimeCollector
::
flush
()
int
ObRSTTimeCollector
::
flush
()
{
{
for
(
int
i
=
0
;
i
<
OB_QRT_OVERALL_COUNT
+
1
;
i
++
)
{
for
(
int
i
=
0
;
i
<
OB_QRT_OVERALL_COUNT
+
1
;
i
++
)
{
count_
[
i
]
=
0
;
ATOMIC_SET
(
&
count_
[
i
],
0
)
;
total_
[
i
]
=
0
;
ATOMIC_SET
(
&
total_
[
i
],
0
)
;
}
}
return
0
;
return
0
;
}
}
...
@@ -92,8 +92,8 @@ int ObRSTTimeCollector::collect(uint64_t time)
...
@@ -92,8 +92,8 @@ int ObRSTTimeCollector::collect(uint64_t time)
int
i
=
0
;
int
i
=
0
;
for
(
int
count
=
utility_
.
bound_count
();
count
>
i
;
++
i
)
{
for
(
int
count
=
utility_
.
bound_count
();
count
>
i
;
++
i
)
{
if
(
utility_
.
bound
(
i
)
>
time
)
{
if
(
utility_
.
bound
(
i
)
>
time
)
{
count_
[
i
]
++
;
ATOMIC_INC
(
&
count_
[
i
])
;
total_
[
i
]
+=
time
;
ATOMIC_FAA
(
&
total_
[
i
],
time
)
;
break
;
break
;
}
}
}
}
...
@@ -140,7 +140,6 @@ int ObRSTCollector::collect_query_response_time(uint64_t tenant_id, uint64_t tim
...
@@ -140,7 +140,6 @@ int ObRSTCollector::collect_query_response_time(uint64_t tenant_id, uint64_t tim
if
(
OB_FAIL
(
ret
=
collector_map_
.
get_refactored
(
tenant_id
,
time_collector
))){
if
(
OB_FAIL
(
ret
=
collector_map_
.
get_refactored
(
tenant_id
,
time_collector
))){
SERVER_LOG
(
WARN
,
"time collector of the tenant does not exist"
,
K
(
tenant_id
),
K
(
time
),
K
(
ret
));
SERVER_LOG
(
WARN
,
"time collector of the tenant does not exist"
,
K
(
tenant_id
),
K
(
time
),
K
(
ret
));
}
else
{
}
else
{
lib
::
ObMutexGuard
guard
(
time_collector
->
mutex_
);
if
(
OB_FAIL
(
ret
=
time_collector
->
collect
(
time
))){
if
(
OB_FAIL
(
ret
=
time_collector
->
collect
(
time
))){
SERVER_LOG
(
WARN
,
"time collector of the tenant collect time failed"
,
K
(
tenant_id
),
K
(
time
),
K
(
ret
));
SERVER_LOG
(
WARN
,
"time collector of the tenant collect time failed"
,
K
(
tenant_id
),
K
(
time
),
K
(
ret
));
}
}
...
@@ -163,7 +162,6 @@ int ObRSTCollector::flush_query_response_time(uint64_t tenant_id,const ObString&
...
@@ -163,7 +162,6 @@ int ObRSTCollector::flush_query_response_time(uint64_t tenant_id,const ObString&
if
(
OB_FAIL
(
ret
=
collector_map_
.
get_refactored
(
tenant_id
,
time_collector
))){
if
(
OB_FAIL
(
ret
=
collector_map_
.
get_refactored
(
tenant_id
,
time_collector
))){
SERVER_LOG
(
WARN
,
"time collector of the tenant does not exist"
,
K
(
ret
),
K
(
tenant_id
));
SERVER_LOG
(
WARN
,
"time collector of the tenant does not exist"
,
K
(
ret
),
K
(
tenant_id
));
}
else
{
}
else
{
lib
::
ObMutexGuard
guard
(
time_collector
->
mutex_
);
if
(
OB_FAIL
(
ret
=
time_collector
->
setup
(
tenant_config
->
query_response_time_range_base
))){
if
(
OB_FAIL
(
ret
=
time_collector
->
setup
(
tenant_config
->
query_response_time_range_base
))){
SERVER_LOG
(
WARN
,
"time collector of the tenant set range base failed"
,
K
(
ret
),
K
(
tenant_id
));
SERVER_LOG
(
WARN
,
"time collector of the tenant set range base failed"
,
K
(
ret
),
K
(
tenant_id
));
}
else
if
(
OB_FAIL
(
ret
=
time_collector
->
flush
())){
}
else
if
(
OB_FAIL
(
ret
=
time_collector
->
flush
())){
...
...
src/observer/mysql/ob_query_response_time.h
浏览文件 @
0cb4c948
...
@@ -69,7 +69,6 @@ class ObRSTTimeCollector {
...
@@ -69,7 +69,6 @@ class ObRSTTimeCollector {
public:
public:
ObRSTUtility
utility_
;
ObRSTUtility
utility_
;
lib
::
ObMutex
mutex_
;
uint32_t
count_
[
OB_QRT_OVERALL_COUNT
];
uint32_t
count_
[
OB_QRT_OVERALL_COUNT
];
uint64_t
total_
[
OB_QRT_OVERALL_COUNT
];
uint64_t
total_
[
OB_QRT_OVERALL_COUNT
];
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录