Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
_Walt
Rocketmq
提交
690a406e
R
Rocketmq
项目概览
_Walt
/
Rocketmq
与 Fork 源项目一致
Fork自
Apache RocketMQ / Rocketmq
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rocketmq
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
690a406e
编写于
3月 06, 2019
作者:
H
hdchen
提交者:
dinglei
3月 06, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[RIP-10] modify test case StatsItemSetTest's param (#1053)
上级
9cf09797
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
10 addition
and
14 deletion
+10
-14
common/src/test/java/org/apache/rocketmq/common/stats/StatsItemSetTest.java
...va/org/apache/rocketmq/common/stats/StatsItemSetTest.java
+10
-14
未找到文件。
common/src/test/java/org/apache/rocketmq/common/stats/StatsItemSetTest.java
浏览文件 @
690a406e
...
@@ -36,23 +36,19 @@ public class StatsItemSetTest {
...
@@ -36,23 +36,19 @@ public class StatsItemSetTest {
@Test
@Test
public
void
test_getAndCreateStatsItem_multiThread
()
throws
InterruptedException
{
public
void
test_getAndCreateStatsItem_multiThread
()
throws
InterruptedException
{
for
(
int
i
=
0
;
i
<
50
;
i
++)
{
assertEquals
(
20L
,
test_unit
().
longValue
());
assertEquals
(
20000L
,
test_unit
().
longValue
());
}
}
}
@Test
@Test
public
void
test_getAndCreateMomentStatsItem_multiThread
()
throws
InterruptedException
{
public
void
test_getAndCreateMomentStatsItem_multiThread
()
throws
InterruptedException
{
for
(
int
i
=
0
;
i
<
50
;
i
++)
{
assertEquals
(
10
,
test_unit_moment
().
longValue
());
assertEquals
(
10
,
test_unit_moment
().
longValue
());
}
}
}
private
AtomicLong
test_unit
()
throws
InterruptedException
{
private
AtomicLong
test_unit
()
throws
InterruptedException
{
final
StatsItemSet
statsItemSet
=
new
StatsItemSet
(
"topicTest"
,
scheduler
,
null
);
final
StatsItemSet
statsItemSet
=
new
StatsItemSet
(
"topicTest"
,
scheduler
,
null
);
executor
=
new
ThreadPoolExecutor
(
10
0
,
20
0
,
10
,
TimeUnit
.
SECONDS
,
executor
=
new
ThreadPoolExecutor
(
10
,
2
0
,
10
,
TimeUnit
.
SECONDS
,
new
ArrayBlockingQueue
<
Runnable
>(
100
00
),
new
ThreadFactoryImpl
(
"testMultiThread"
));
new
ArrayBlockingQueue
<
Runnable
>(
100
),
new
ThreadFactoryImpl
(
"testMultiThread"
));
for
(
int
i
=
0
;
i
<
10
000
;
i
++)
{
for
(
int
i
=
0
;
i
<
10
;
i
++)
{
executor
.
submit
(
new
Runnable
()
{
executor
.
submit
(
new
Runnable
()
{
@Override
@Override
public
void
run
()
{
public
void
run
()
{
...
@@ -61,7 +57,7 @@ public class StatsItemSetTest {
...
@@ -61,7 +57,7 @@ public class StatsItemSetTest {
});
});
}
}
while
(
true
)
{
while
(
true
)
{
if
(
executor
.
getCompletedTaskCount
()
==
10
000
)
{
if
(
executor
.
getCompletedTaskCount
()
==
10
)
{
break
;
break
;
}
}
Thread
.
sleep
(
1000
);
Thread
.
sleep
(
1000
);
...
@@ -71,9 +67,9 @@ public class StatsItemSetTest {
...
@@ -71,9 +67,9 @@ public class StatsItemSetTest {
private
AtomicLong
test_unit_moment
()
throws
InterruptedException
{
private
AtomicLong
test_unit_moment
()
throws
InterruptedException
{
final
MomentStatsItemSet
statsItemSet
=
new
MomentStatsItemSet
(
"topicTest"
,
scheduler
,
null
);
final
MomentStatsItemSet
statsItemSet
=
new
MomentStatsItemSet
(
"topicTest"
,
scheduler
,
null
);
executor
=
new
ThreadPoolExecutor
(
10
0
,
20
0
,
10
,
TimeUnit
.
SECONDS
,
executor
=
new
ThreadPoolExecutor
(
10
,
2
0
,
10
,
TimeUnit
.
SECONDS
,
new
ArrayBlockingQueue
<
Runnable
>(
100
00
),
new
ThreadFactoryImpl
(
"testMultiThread"
));
new
ArrayBlockingQueue
<
Runnable
>(
100
),
new
ThreadFactoryImpl
(
"testMultiThread"
));
for
(
int
i
=
0
;
i
<
10
000
;
i
++)
{
for
(
int
i
=
0
;
i
<
10
;
i
++)
{
executor
.
submit
(
new
Runnable
()
{
executor
.
submit
(
new
Runnable
()
{
@Override
@Override
public
void
run
()
{
public
void
run
()
{
...
@@ -82,7 +78,7 @@ public class StatsItemSetTest {
...
@@ -82,7 +78,7 @@ public class StatsItemSetTest {
});
});
}
}
while
(
true
)
{
while
(
true
)
{
if
(
executor
.
getCompletedTaskCount
()
==
10
000
)
{
if
(
executor
.
getCompletedTaskCount
()
==
10
)
{
break
;
break
;
}
}
Thread
.
sleep
(
1000
);
Thread
.
sleep
(
1000
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录