Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Apache RocketMQ
Rocketmq
提交
857d28df
R
Rocketmq
项目概览
Apache RocketMQ
/
Rocketmq
上一次同步 大约 3 年
通知
267
Star
16139
Fork
68
代码
文件
提交
分支
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看板
未验证
提交
857d28df
编写于
9月 05, 2021
作者:
【
【keepal】
提交者:
GitHub
9月 05, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[ISSUE #3284]Optimizing benchmark code (#3317)
上级
2cac8662
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
65 addition
and
60 deletion
+65
-60
example/src/main/java/org/apache/rocketmq/example/benchmark/BatchProducer.java
.../org/apache/rocketmq/example/benchmark/BatchProducer.java
+35
-33
example/src/main/java/org/apache/rocketmq/example/benchmark/TransactionProducer.java
...pache/rocketmq/example/benchmark/TransactionProducer.java
+30
-27
未找到文件。
example/src/main/java/org/apache/rocketmq/example/benchmark/BatchProducer.java
浏览文件 @
857d28df
...
@@ -26,6 +26,8 @@ import java.util.TimerTask;
...
@@ -26,6 +26,8 @@ import java.util.TimerTask;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
import
java.util.concurrent.Executors
;
import
java.util.concurrent.atomic.AtomicLong
;
import
java.util.concurrent.atomic.AtomicLong
;
import
java.util.concurrent.atomic.LongAdder
;
import
org.apache.commons.cli.CommandLine
;
import
org.apache.commons.cli.CommandLine
;
import
org.apache.commons.cli.Option
;
import
org.apache.commons.cli.Option
;
import
org.apache.commons.cli.Options
;
import
org.apache.commons.cli.Options
;
...
@@ -100,22 +102,22 @@ public class BatchProducer {
...
@@ -100,22 +102,22 @@ public class BatchProducer {
try
{
try
{
long
beginTimestamp
=
System
.
currentTimeMillis
();
long
beginTimestamp
=
System
.
currentTimeMillis
();
long
sendSucCount
=
statsBenchmark
.
getSendMessageSuccessCount
().
get
();
long
sendSucCount
=
statsBenchmark
.
getSendMessageSuccessCount
().
longValue
();
setKeys
(
keyEnable
,
msgs
,
String
.
valueOf
(
beginTimestamp
/
1000
));
setKeys
(
keyEnable
,
msgs
,
String
.
valueOf
(
beginTimestamp
/
1000
));
setTags
(
tagCount
,
msgs
,
sendSucCount
);
setTags
(
tagCount
,
msgs
,
sendSucCount
);
setProperties
(
propertySize
,
msgs
);
setProperties
(
propertySize
,
msgs
);
SendResult
sendResult
=
producer
.
send
(
msgs
);
SendResult
sendResult
=
producer
.
send
(
msgs
);
if
(
sendResult
.
getSendStatus
()
==
SendStatus
.
SEND_OK
)
{
if
(
sendResult
.
getSendStatus
()
==
SendStatus
.
SEND_OK
)
{
statsBenchmark
.
getSendRequestSuccessCount
().
increment
AndGet
();
statsBenchmark
.
getSendRequestSuccessCount
().
increment
();
statsBenchmark
.
getSendMessageSuccessCount
().
add
AndGet
(
msgs
.
size
());
statsBenchmark
.
getSendMessageSuccessCount
().
add
(
msgs
.
size
());
}
else
{
}
else
{
statsBenchmark
.
getSendRequestFailedCount
().
increment
AndGet
();
statsBenchmark
.
getSendRequestFailedCount
().
increment
();
statsBenchmark
.
getSendMessageFailedCount
().
add
AndGet
(
msgs
.
size
());
statsBenchmark
.
getSendMessageFailedCount
().
add
(
msgs
.
size
());
}
}
long
currentRT
=
System
.
currentTimeMillis
()
-
beginTimestamp
;
long
currentRT
=
System
.
currentTimeMillis
()
-
beginTimestamp
;
statsBenchmark
.
getSendMessageSuccessTimeTotal
().
add
AndGet
(
currentRT
);
statsBenchmark
.
getSendMessageSuccessTimeTotal
().
add
(
currentRT
);
long
prevMaxRT
=
statsBenchmark
.
getSendMessageMaxRT
().
get
();
long
prevMaxRT
=
statsBenchmark
.
getSendMessageMaxRT
().
longValue
();
while
(
currentRT
>
prevMaxRT
)
{
while
(
currentRT
>
prevMaxRT
)
{
boolean
updated
=
statsBenchmark
.
getSendMessageMaxRT
().
compareAndSet
(
prevMaxRT
,
currentRT
);
boolean
updated
=
statsBenchmark
.
getSendMessageMaxRT
().
compareAndSet
(
prevMaxRT
,
currentRT
);
if
(
updated
)
{
if
(
updated
)
{
...
@@ -125,8 +127,8 @@ public class BatchProducer {
...
@@ -125,8 +127,8 @@ public class BatchProducer {
prevMaxRT
=
statsBenchmark
.
getSendMessageMaxRT
().
get
();
prevMaxRT
=
statsBenchmark
.
getSendMessageMaxRT
().
get
();
}
}
}
catch
(
RemotingException
e
)
{
}
catch
(
RemotingException
e
)
{
statsBenchmark
.
getSendRequestFailedCount
().
increment
AndGet
();
statsBenchmark
.
getSendRequestFailedCount
().
increment
();
statsBenchmark
.
getSendMessageFailedCount
().
add
AndGet
(
msgs
.
size
());
statsBenchmark
.
getSendMessageFailedCount
().
add
(
msgs
.
size
());
log
.
error
(
"[BENCHMARK_PRODUCER] Send Exception"
,
e
);
log
.
error
(
"[BENCHMARK_PRODUCER] Send Exception"
,
e
);
try
{
try
{
...
@@ -134,22 +136,22 @@ public class BatchProducer {
...
@@ -134,22 +136,22 @@ public class BatchProducer {
}
catch
(
InterruptedException
ignored
)
{
}
catch
(
InterruptedException
ignored
)
{
}
}
}
catch
(
InterruptedException
e
)
{
}
catch
(
InterruptedException
e
)
{
statsBenchmark
.
getSendRequestFailedCount
().
increment
AndGet
();
statsBenchmark
.
getSendRequestFailedCount
().
increment
();
statsBenchmark
.
getSendMessageFailedCount
().
add
AndGet
(
msgs
.
size
());
statsBenchmark
.
getSendMessageFailedCount
().
add
(
msgs
.
size
());
try
{
try
{
Thread
.
sleep
(
3000
);
Thread
.
sleep
(
3000
);
}
catch
(
InterruptedException
e1
)
{
}
catch
(
InterruptedException
e1
)
{
}
}
statsBenchmark
.
getSendRequestFailedCount
().
increment
AndGet
();
statsBenchmark
.
getSendRequestFailedCount
().
increment
();
statsBenchmark
.
getSendMessageFailedCount
().
add
AndGet
(
msgs
.
size
());
statsBenchmark
.
getSendMessageFailedCount
().
add
(
msgs
.
size
());
log
.
error
(
"[BENCHMARK_PRODUCER] Send Exception"
,
e
);
log
.
error
(
"[BENCHMARK_PRODUCER] Send Exception"
,
e
);
}
catch
(
MQClientException
e
)
{
}
catch
(
MQClientException
e
)
{
statsBenchmark
.
getSendRequestFailedCount
().
increment
AndGet
();
statsBenchmark
.
getSendRequestFailedCount
().
increment
();
statsBenchmark
.
getSendMessageFailedCount
().
add
AndGet
(
msgs
.
size
());
statsBenchmark
.
getSendMessageFailedCount
().
add
(
msgs
.
size
());
log
.
error
(
"[BENCHMARK_PRODUCER] Send Exception"
,
e
);
log
.
error
(
"[BENCHMARK_PRODUCER] Send Exception"
,
e
);
}
catch
(
MQBrokerException
e
)
{
}
catch
(
MQBrokerException
e
)
{
statsBenchmark
.
getSendRequestFailedCount
().
increment
AndGet
();
statsBenchmark
.
getSendRequestFailedCount
().
increment
();
statsBenchmark
.
getSendMessageFailedCount
().
add
AndGet
(
msgs
.
size
());
statsBenchmark
.
getSendMessageFailedCount
().
add
(
msgs
.
size
());
log
.
error
(
"[BENCHMARK_PRODUCER] Send Exception"
,
e
);
log
.
error
(
"[BENCHMARK_PRODUCER] Send Exception"
,
e
);
try
{
try
{
Thread
.
sleep
(
3000
);
Thread
.
sleep
(
3000
);
...
@@ -313,17 +315,17 @@ public class BatchProducer {
...
@@ -313,17 +315,17 @@ public class BatchProducer {
class
StatsBenchmarkBatchProducer
{
class
StatsBenchmarkBatchProducer
{
private
final
AtomicLong
sendRequestSuccessCount
=
new
AtomicLong
(
0L
);
private
final
LongAdder
sendRequestSuccessCount
=
new
LongAdder
(
);
private
final
AtomicLong
sendRequestFailedCount
=
new
AtomicLong
(
0L
);
private
final
LongAdder
sendRequestFailedCount
=
new
LongAdder
(
);
private
final
AtomicLong
sendMessageSuccessTimeTotal
=
new
AtomicLong
(
0L
);
private
final
LongAdder
sendMessageSuccessTimeTotal
=
new
LongAdder
(
);
private
final
AtomicLong
sendMessageMaxRT
=
new
AtomicLong
(
0L
);
private
final
AtomicLong
sendMessageMaxRT
=
new
AtomicLong
(
0L
);
private
final
AtomicLong
sendMessageSuccessCount
=
new
AtomicLong
(
0L
);
private
final
LongAdder
sendMessageSuccessCount
=
new
LongAdder
(
);
private
final
AtomicLong
sendMessageFailedCount
=
new
AtomicLong
(
0L
);
private
final
LongAdder
sendMessageFailedCount
=
new
LongAdder
(
);
private
final
Timer
timer
=
new
Timer
(
"BenchmarkTimerThread"
,
true
);
private
final
Timer
timer
=
new
Timer
(
"BenchmarkTimerThread"
,
true
);
...
@@ -332,25 +334,25 @@ class StatsBenchmarkBatchProducer {
...
@@ -332,25 +334,25 @@ class StatsBenchmarkBatchProducer {
public
Long
[]
createSnapshot
()
{
public
Long
[]
createSnapshot
()
{
Long
[]
snap
=
new
Long
[]
{
Long
[]
snap
=
new
Long
[]
{
System
.
currentTimeMillis
(),
System
.
currentTimeMillis
(),
this
.
sendRequestSuccessCount
.
get
(),
this
.
sendRequestSuccessCount
.
longValue
(),
this
.
sendRequestFailedCount
.
get
(),
this
.
sendRequestFailedCount
.
longValue
(),
this
.
sendMessageSuccessCount
.
get
(),
this
.
sendMessageSuccessCount
.
longValue
(),
this
.
sendMessageFailedCount
.
get
(),
this
.
sendMessageFailedCount
.
longValue
(),
this
.
sendMessageSuccessTimeTotal
.
get
(),
this
.
sendMessageSuccessTimeTotal
.
longValue
(),
};
};
return
snap
;
return
snap
;
}
}
public
AtomicLong
getSendRequestSuccessCount
()
{
public
LongAdder
getSendRequestSuccessCount
()
{
return
sendRequestSuccessCount
;
return
sendRequestSuccessCount
;
}
}
public
AtomicLong
getSendRequestFailedCount
()
{
public
LongAdder
getSendRequestFailedCount
()
{
return
sendRequestFailedCount
;
return
sendRequestFailedCount
;
}
}
public
AtomicLong
getSendMessageSuccessTimeTotal
()
{
public
LongAdder
getSendMessageSuccessTimeTotal
()
{
return
sendMessageSuccessTimeTotal
;
return
sendMessageSuccessTimeTotal
;
}
}
...
@@ -358,11 +360,11 @@ class StatsBenchmarkBatchProducer {
...
@@ -358,11 +360,11 @@ class StatsBenchmarkBatchProducer {
return
sendMessageMaxRT
;
return
sendMessageMaxRT
;
}
}
public
AtomicLong
getSendMessageSuccessCount
()
{
public
LongAdder
getSendMessageSuccessCount
()
{
return
sendMessageSuccessCount
;
return
sendMessageSuccessCount
;
}
}
public
AtomicLong
getSendMessageFailedCount
()
{
public
LongAdder
getSendMessageFailedCount
()
{
return
sendMessageFailedCount
;
return
sendMessageFailedCount
;
}
}
...
@@ -390,7 +392,7 @@ class StatsBenchmarkBatchProducer {
...
@@ -390,7 +392,7 @@ class StatsBenchmarkBatchProducer {
final
double
averageMsgRT
=
(
end
[
5
]
-
begin
[
5
])
/
(
double
)
(
end
[
3
]
-
begin
[
3
]);
final
double
averageMsgRT
=
(
end
[
5
]
-
begin
[
5
])
/
(
double
)
(
end
[
3
]
-
begin
[
3
]);
System
.
out
.
printf
(
"Current Time: %s Send TPS: %d Send MPS: %d Max RT(ms): %d Average RT(ms): %7.3f Average Message RT(ms): %7.3f Send Failed: %d Send Message Failed: %d%n"
,
System
.
out
.
printf
(
"Current Time: %s Send TPS: %d Send MPS: %d Max RT(ms): %d Average RT(ms): %7.3f Average Message RT(ms): %7.3f Send Failed: %d Send Message Failed: %d%n"
,
System
.
currentTimeMillis
(),
sendTps
,
sendMps
,
getSendMessageMaxRT
().
get
(),
averageRT
,
averageMsgRT
,
end
[
2
],
end
[
4
]);
System
.
currentTimeMillis
(),
sendTps
,
sendMps
,
getSendMessageMaxRT
().
longValue
(),
averageRT
,
averageMsgRT
,
end
[
2
],
end
[
4
]);
}
}
}
}
...
...
example/src/main/java/org/apache/rocketmq/example/benchmark/TransactionProducer.java
浏览文件 @
857d28df
...
@@ -50,10 +50,11 @@ import java.util.concurrent.atomic.AtomicLong;
...
@@ -50,10 +50,11 @@ import java.util.concurrent.atomic.AtomicLong;
import
java.util.concurrent.ScheduledExecutorService
;
import
java.util.concurrent.ScheduledExecutorService
;
import
java.util.concurrent.ScheduledThreadPoolExecutor
;
import
java.util.concurrent.ScheduledThreadPoolExecutor
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.atomic.LongAdder
;
public
class
TransactionProducer
{
public
class
TransactionProducer
{
private
static
final
long
START_TIME
=
System
.
currentTimeMillis
();
private
static
final
long
START_TIME
=
System
.
currentTimeMillis
();
private
static
final
AtomicLong
MSG_COUNT
=
new
AtomicLong
(
0
);
private
static
final
LongAdder
MSG_COUNT
=
new
LongAdder
(
);
//broker max check times should less than this value
//broker max check times should less than this value
static
final
int
MAX_CHECK_RESULT_IN_MSG
=
20
;
static
final
int
MAX_CHECK_RESULT_IN_MSG
=
20
;
...
@@ -158,7 +159,7 @@ public class TransactionProducer {
...
@@ -158,7 +159,7 @@ public class TransactionProducer {
success
=
false
;
success
=
false
;
}
finally
{
}
finally
{
final
long
currentRT
=
System
.
currentTimeMillis
()
-
beginTimestamp
;
final
long
currentRT
=
System
.
currentTimeMillis
()
-
beginTimestamp
;
statsBenchmark
.
getSendMessageTimeTotal
().
add
AndGet
(
currentRT
);
statsBenchmark
.
getSendMessageTimeTotal
().
add
(
currentRT
);
long
prevMaxRT
=
statsBenchmark
.
getSendMessageMaxRT
().
get
();
long
prevMaxRT
=
statsBenchmark
.
getSendMessageMaxRT
().
get
();
while
(
currentRT
>
prevMaxRT
)
{
while
(
currentRT
>
prevMaxRT
)
{
boolean
updated
=
statsBenchmark
.
getSendMessageMaxRT
()
boolean
updated
=
statsBenchmark
.
getSendMessageMaxRT
()
...
@@ -169,9 +170,9 @@ public class TransactionProducer {
...
@@ -169,9 +170,9 @@ public class TransactionProducer {
prevMaxRT
=
statsBenchmark
.
getSendMessageMaxRT
().
get
();
prevMaxRT
=
statsBenchmark
.
getSendMessageMaxRT
().
get
();
}
}
if
(
success
)
{
if
(
success
)
{
statsBenchmark
.
getSendRequestSuccessCount
().
increment
AndGet
();
statsBenchmark
.
getSendRequestSuccessCount
().
increment
();
}
else
{
}
else
{
statsBenchmark
.
getSendRequestFailedCount
().
increment
AndGet
();
statsBenchmark
.
getSendRequestFailedCount
().
increment
();
}
}
if
(
config
.
sendInterval
>
0
)
{
if
(
config
.
sendInterval
>
0
)
{
try
{
try
{
...
@@ -194,7 +195,9 @@ public class TransactionProducer {
...
@@ -194,7 +195,9 @@ public class TransactionProducer {
ByteBuffer
buf
=
ByteBuffer
.
wrap
(
bs
);
ByteBuffer
buf
=
ByteBuffer
.
wrap
(
bs
);
buf
.
putLong
(
config
.
batchId
);
buf
.
putLong
(
config
.
batchId
);
long
sendMachineId
=
START_TIME
<<
32
;
long
sendMachineId
=
START_TIME
<<
32
;
long
msgId
=
sendMachineId
|
MSG_COUNT
.
getAndIncrement
();
long
count
=
MSG_COUNT
.
longValue
();
long
msgId
=
sendMachineId
|
count
;
MSG_COUNT
.
increment
();
buf
.
putLong
(
msgId
);
buf
.
putLong
(
msgId
);
// save send tx result in message
// save send tx result in message
...
@@ -316,7 +319,7 @@ class TransactionListenerImpl implements TransactionListener {
...
@@ -316,7 +319,7 @@ class TransactionListenerImpl implements TransactionListener {
// message not generated in this test
// message not generated in this test
return
LocalTransactionState
.
ROLLBACK_MESSAGE
;
return
LocalTransactionState
.
ROLLBACK_MESSAGE
;
}
}
statBenchmark
.
getCheckCount
().
increment
AndGet
();
statBenchmark
.
getCheckCount
().
increment
();
int
times
=
0
;
int
times
=
0
;
try
{
try
{
...
@@ -339,7 +342,7 @@ class TransactionListenerImpl implements TransactionListener {
...
@@ -339,7 +342,7 @@ class TransactionListenerImpl implements TransactionListener {
dup
=
newCheckLog
.
equals
(
oldCheckLog
);
dup
=
newCheckLog
.
equals
(
oldCheckLog
);
}
}
if
(
dup
)
{
if
(
dup
)
{
statBenchmark
.
getDuplicatedCheckCount
().
increment
AndGet
();
statBenchmark
.
getDuplicatedCheckCount
().
increment
();
}
}
if
(
msgMeta
.
sendResult
!=
LocalTransactionState
.
UNKNOW
)
{
if
(
msgMeta
.
sendResult
!=
LocalTransactionState
.
UNKNOW
)
{
System
.
out
.
printf
(
"%s unexpected check: msgId=%s,txId=%s,checkTimes=%s,sendResult=%s\n"
,
System
.
out
.
printf
(
"%s unexpected check: msgId=%s,txId=%s,checkTimes=%s,sendResult=%s\n"
,
...
@@ -347,7 +350,7 @@ class TransactionListenerImpl implements TransactionListener {
...
@@ -347,7 +350,7 @@ class TransactionListenerImpl implements TransactionListener {
msg
.
getMsgId
(),
msg
.
getTransactionId
(),
msg
.
getMsgId
(),
msg
.
getTransactionId
(),
msg
.
getUserProperty
(
MessageConst
.
PROPERTY_TRANSACTION_CHECK_TIMES
),
msg
.
getUserProperty
(
MessageConst
.
PROPERTY_TRANSACTION_CHECK_TIMES
),
msgMeta
.
sendResult
.
toString
());
msgMeta
.
sendResult
.
toString
());
statBenchmark
.
getUnexpectedCheckCount
().
increment
AndGet
();
statBenchmark
.
getUnexpectedCheckCount
().
increment
();
return
msgMeta
.
sendResult
;
return
msgMeta
.
sendResult
;
}
}
...
@@ -358,7 +361,7 @@ class TransactionListenerImpl implements TransactionListener {
...
@@ -358,7 +361,7 @@ class TransactionListenerImpl implements TransactionListener {
new
SimpleDateFormat
(
"HH:mm:ss,SSS"
).
format
(
new
Date
()),
new
SimpleDateFormat
(
"HH:mm:ss,SSS"
).
format
(
new
Date
()),
msg
.
getMsgId
(),
msg
.
getTransactionId
(),
msg
.
getMsgId
(),
msg
.
getTransactionId
(),
msg
.
getUserProperty
(
MessageConst
.
PROPERTY_TRANSACTION_CHECK_TIMES
),
s
);
msg
.
getUserProperty
(
MessageConst
.
PROPERTY_TRANSACTION_CHECK_TIMES
),
s
);
statBenchmark
.
getUnexpectedCheckCount
().
increment
AndGet
();
statBenchmark
.
getUnexpectedCheckCount
().
increment
();
return
s
;
return
s
;
}
}
}
}
...
@@ -385,42 +388,42 @@ class Snapshot {
...
@@ -385,42 +388,42 @@ class Snapshot {
}
}
class
StatsBenchmarkTProducer
{
class
StatsBenchmarkTProducer
{
private
final
AtomicLong
sendRequestSuccessCount
=
new
AtomicLong
(
0L
);
private
final
LongAdder
sendRequestSuccessCount
=
new
LongAdder
(
);
private
final
AtomicLong
sendRequestFailedCount
=
new
AtomicLong
(
0L
);
private
final
LongAdder
sendRequestFailedCount
=
new
LongAdder
(
);
private
final
AtomicLong
sendMessageTimeTotal
=
new
AtomicLong
(
0L
);
private
final
LongAdder
sendMessageTimeTotal
=
new
LongAdder
(
);
private
final
AtomicLong
sendMessageMaxRT
=
new
AtomicLong
(
0L
);
private
final
AtomicLong
sendMessageMaxRT
=
new
AtomicLong
(
0L
);
private
final
AtomicLong
checkCount
=
new
AtomicLong
(
0L
);
private
final
LongAdder
checkCount
=
new
LongAdder
(
);
private
final
AtomicLong
unexpectedCheckCount
=
new
AtomicLong
(
0L
);
private
final
LongAdder
unexpectedCheckCount
=
new
LongAdder
(
);
private
final
AtomicLong
duplicatedCheckCount
=
new
AtomicLong
(
0
);
private
final
LongAdder
duplicatedCheckCount
=
new
LongAdder
(
);
public
Snapshot
createSnapshot
()
{
public
Snapshot
createSnapshot
()
{
Snapshot
s
=
new
Snapshot
();
Snapshot
s
=
new
Snapshot
();
s
.
endTime
=
System
.
currentTimeMillis
();
s
.
endTime
=
System
.
currentTimeMillis
();
s
.
sendRequestSuccessCount
=
sendRequestSuccessCount
.
get
();
s
.
sendRequestSuccessCount
=
sendRequestSuccessCount
.
longValue
();
s
.
sendRequestFailedCount
=
sendRequestFailedCount
.
get
();
s
.
sendRequestFailedCount
=
sendRequestFailedCount
.
longValue
();
s
.
sendMessageTimeTotal
=
sendMessageTimeTotal
.
get
();
s
.
sendMessageTimeTotal
=
sendMessageTimeTotal
.
longValue
();
s
.
sendMessageMaxRT
=
sendMessageMaxRT
.
get
();
s
.
sendMessageMaxRT
=
sendMessageMaxRT
.
get
();
s
.
checkCount
=
checkCount
.
get
();
s
.
checkCount
=
checkCount
.
longValue
();
s
.
unexpectedCheckCount
=
unexpectedCheckCount
.
get
();
s
.
unexpectedCheckCount
=
unexpectedCheckCount
.
longValue
();
s
.
duplicatedCheck
=
duplicatedCheckCount
.
get
();
s
.
duplicatedCheck
=
duplicatedCheckCount
.
longValue
();
return
s
;
return
s
;
}
}
public
AtomicLong
getSendRequestSuccessCount
()
{
public
LongAdder
getSendRequestSuccessCount
()
{
return
sendRequestSuccessCount
;
return
sendRequestSuccessCount
;
}
}
public
AtomicLong
getSendRequestFailedCount
()
{
public
LongAdder
getSendRequestFailedCount
()
{
return
sendRequestFailedCount
;
return
sendRequestFailedCount
;
}
}
public
AtomicLong
getSendMessageTimeTotal
()
{
public
LongAdder
getSendMessageTimeTotal
()
{
return
sendMessageTimeTotal
;
return
sendMessageTimeTotal
;
}
}
...
@@ -428,15 +431,15 @@ class StatsBenchmarkTProducer {
...
@@ -428,15 +431,15 @@ class StatsBenchmarkTProducer {
return
sendMessageMaxRT
;
return
sendMessageMaxRT
;
}
}
public
AtomicLong
getCheckCount
()
{
public
LongAdder
getCheckCount
()
{
return
checkCount
;
return
checkCount
;
}
}
public
AtomicLong
getUnexpectedCheckCount
()
{
public
LongAdder
getUnexpectedCheckCount
()
{
return
unexpectedCheckCount
;
return
unexpectedCheckCount
;
}
}
public
AtomicLong
getDuplicatedCheckCount
()
{
public
LongAdder
getDuplicatedCheckCount
()
{
return
duplicatedCheckCount
;
return
duplicatedCheckCount
;
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录