You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "TAKETODAY (via GitHub)" <gi...@apache.org> on 2023/03/22 08:21:06 UTC
[GitHub] [rocketmq-exporter] TAKETODAY opened a new issue, #131: BrokerRuntimeStats#loadTps NPE
TAKETODAY opened a new issue, #131:
URL: https://github.com/apache/rocketmq-exporter/issues/131
**Describe the bug**
```log
java.lang.NullPointerException: null
at org.apache.rocketmq.exporter.model.BrokerRuntimeStats.loadTps(BrokerRuntimeStats.java:149)
at org.apache.rocketmq.exporter.model.BrokerRuntimeStats.<init>(BrokerRuntimeStats.java:94)
at org.apache.rocketmq.exporter.task.MetricsCollectTask.collectBrokerRuntimeStats(MetricsCollectTask.java:685)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84)
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:93)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:750)
```
原始代码:
https://github.com/apache/rocketmq-exporter/blob/5fb1de22cd12555164103771aa42d93d00768ba5/src/main/java/org/apache/rocketmq/exporter/model/BrokerRuntimeStats.java#L149
```java
private void loadTps(PutTps putTps, String value) {
String[] arr = value.split(" ");
if (arr.length >= 1) {
putTps.ten = Double.parseDouble(arr[0]);
}
if (arr.length >= 2) {
putTps.sixty = Double.parseDouble(arr[1]);
}
if (arr.length >= 3) {
putTps.sixHundred = Double.parseDouble(arr[2]);
}
}
```
修改后:
```java
private void loadTps(PutTps putTps, String value) {
if (value != null) {
String[] arr = value.split(" ");
if (arr.length >= 1) {
putTps.ten = Double.parseDouble(arr[0]);
}
if (arr.length >= 2) {
putTps.sixty = Double.parseDouble(arr[1]);
}
if (arr.length >= 3) {
putTps.sixHundred = Double.parseDouble(arr[2]);
}
}
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq-exporter] TAKETODAY commented on issue #131: BrokerRuntimeStats#loadTps NPE
Posted by "TAKETODAY (via GitHub)" <gi...@apache.org>.
TAKETODAY commented on issue #131:
URL: https://github.com/apache/rocketmq-exporter/issues/131#issuecomment-1480483620
yes
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq-exporter] HansGerry commented on issue #131: BrokerRuntimeStats#loadTps NPE
Posted by "HansGerry (via GitHub)" <gi...@apache.org>.
HansGerry commented on issue #131:
URL: https://github.com/apache/rocketmq-exporter/issues/131#issuecomment-1480445532
Spelling errors:getTransferredTps 、getTransferedTps
rocketmqversion:4.9.4
![image](https://user-images.githubusercontent.com/32202815/227072930-9b3fd65a-bf39-4c15-a79b-a11fa1e7735c.png)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] BrokerRuntimeStats#loadTps NPE [rocketmq-exporter]
Posted by "cserwen (via GitHub)" <gi...@apache.org>.
cserwen closed issue #131: BrokerRuntimeStats#loadTps NPE
URL: https://github.com/apache/rocketmq-exporter/issues/131
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org