Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
oceanbase
miniob
提交
b18424d2
M
miniob
项目概览
oceanbase
/
miniob
大约 1 年 前同步成功
通知
74
Star
1521
Fork
537
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
分析
仓库
DevOps
项目成员
Pages
M
miniob
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Pages
分析
分析
仓库分析
DevOps
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
提交
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
b18424d2
编写于
9月 21, 2022
作者:
夏
夏克
提交者:
GitHub
9月 21, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix issue 'client_performance_test' failed (#80)
* stage线程分配问题 #75 * 客户端连接可以指定host和port
上级
cf468822
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
23 addition
and
8 deletion
+23
-8
deps/common/seda/thread_pool.cpp
deps/common/seda/thread_pool.cpp
+5
-3
deps/common/seda/timer_stage.cpp
deps/common/seda/timer_stage.cpp
+4
-0
test/perf/client_performance_test.cpp
test/perf/client_performance_test.cpp
+14
-5
未找到文件。
deps/common/seda/thread_pool.cpp
浏览文件 @
b18424d2
...
...
@@ -107,9 +107,6 @@ unsigned int Threadpool::add_threads(unsigned int threads)
LOG_WARN
(
"Failed to create one thread
\n
"
);
break
;
}
char
tmp
[
16
]
=
{};
snprintf
(
tmp
,
sizeof
(
tmp
),
"%s%u"
,
name_
.
c_str
(),
i
);
pthread_setname_np
(
pthread
,
tmp
);
}
nthreads_
+=
i
;
MUTEX_UNLOCK
(
&
thread_mutex_
);
...
...
@@ -259,6 +256,11 @@ void *Threadpool::run_thread(void *pool_ptr)
// this is not portable, but is easier to map to LWP
s64_t
threadid
=
gettid
();
LOG_INFO
(
"threadid = %llx, threadname = %s
\n
"
,
threadid
,
pool
->
get_name
().
c_str
());
#ifdef __APPLE__
pthread_setname_np
(
pool
->
get_name
().
c_str
());
#else
pthread_setname_np
(
pthread_self
(),
pool
->
get_name
().
c_str
());
#endif
// enter a loop where we continuously look for events from Stages on
// the run_queue_ and handle the event.
...
...
deps/common/seda/timer_stage.cpp
浏览文件 @
b18424d2
...
...
@@ -296,7 +296,11 @@ bool TimerStage::initialize()
if
(
status
!=
0
)
LOG_ERROR
(
"failed to create timer thread: status=%d
\n
"
,
status
);
else
#ifdef __APPLE__
pthread_setname_np
(
"TimerStage"
);
#else
pthread_setname_np
(
timer_thread_id_
,
"TimerStage"
);
#endif
return
(
status
==
0
);
}
...
...
test/perf/client_performance_test.cpp
浏览文件 @
b18424d2
...
...
@@ -30,10 +30,11 @@ See the Mulan PSL v2 for more details. */
#include "common/metrics/console_reporter.h"
#define MAX_MEM_BUFFER_SIZE 8192
#define PORT_DEFAULT 6
6
789
#define PORT_DEFAULT 6789
using
namespace
common
;
char
*
server_host
=
(
char
*
)
LOCAL_HOST
;
int
server_port
=
PORT_DEFAULT
;
void
*
test_server
(
void
*
param
)
{
...
...
@@ -60,7 +61,7 @@ void *test_server(void *param)
}
serv_addr
.
sin_family
=
AF_INET
;
serv_addr
.
sin_port
=
htons
((
uint16_t
)
PORT_DEFAULT
);
serv_addr
.
sin_port
=
htons
((
uint16_t
)
server_port
);
serv_addr
.
sin_addr
=
*
((
struct
in_addr
*
)
host
->
h_addr
);
bzero
(
&
(
serv_addr
.
sin_zero
),
8
);
...
...
@@ -95,9 +96,17 @@ void *test_server(void *param)
int
main
(
int
argc
,
char
*
argv
[])
{
if
(
argc
>=
2
)
{
server_host
=
argv
[
1
];
int
opt
;
extern
char
*
optarg
;
while
((
opt
=
getopt
(
argc
,
argv
,
"h:p:"
))
>
0
)
{
switch
(
opt
)
{
case
'p'
:
server_port
=
atoi
(
optarg
);
break
;
case
'h'
:
server_host
=
optarg
;
break
;
}
}
MetricsRegistry
&
metric_registry
=
get_metrics_registry
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录