diff --git a/src/main/java/com/handu/open/dubbo/monitor/controller/StatisticsController.java b/src/main/java/com/handu/open/dubbo/monitor/controller/StatisticsController.java index a49e483..18aec64 100644 --- a/src/main/java/com/handu/open/dubbo/monitor/controller/StatisticsController.java +++ b/src/main/java/com/handu/open/dubbo/monitor/controller/StatisticsController.java @@ -64,7 +64,7 @@ public String index(@ModelAttribute DubboInvoke dubboInvoke, Model model) { } dubboStatistics.setProviderSuccess(di.getSuccess()); dubboStatistics.setProviderFailure(di.getFailure()); - dubboStatistics.setProviderAvgElapsed(di.getSuccess() != 0 ? di.getElapsed() / di.getSuccess() : 0); + dubboStatistics.setProviderAvgElapsed(di.getSuccess() != 0 ? Double.valueOf(String.format("%.4f", di.getElapsed() / di.getSuccess())) : 0); dubboStatistics.setProviderMaxElapsed(di.getMaxElapsed()); dubboStatistics.setProviderMaxConcurrent(di.getMaxConcurrent()); } @@ -76,7 +76,7 @@ public String index(@ModelAttribute DubboInvoke dubboInvoke, Model model) { } dubboStatistics.setConsumerSuccess(di.getSuccess()); dubboStatistics.setConsumerFailure(di.getFailure()); - dubboStatistics.setConsumerAvgElapsed(di.getSuccess() != 0 ? di.getElapsed() / di.getSuccess() : 0); + dubboStatistics.setConsumerAvgElapsed(di.getSuccess() != 0 ? Double.valueOf(String.format("%.4f", di.getElapsed() / di.getSuccess())) : 0); dubboStatistics.setConsumerMaxElapsed(di.getMaxElapsed()); dubboStatistics.setConsumerMaxConcurrent(di.getMaxConcurrent()); } diff --git a/src/main/java/com/handu/open/dubbo/monitor/domain/DubboInvoke.java b/src/main/java/com/handu/open/dubbo/monitor/domain/DubboInvoke.java index 5e11db4..7d5a9e6 100644 --- a/src/main/java/com/handu/open/dubbo/monitor/domain/DubboInvoke.java +++ b/src/main/java/com/handu/open/dubbo/monitor/domain/DubboInvoke.java @@ -48,13 +48,13 @@ public class DubboInvoke implements Serializable { private double elapsed; - private double concurrent; + private int concurrent; - private double maxElapsed; + private int maxElapsed; - private double maxConcurrent; + private int maxConcurrent; - private double invokeTime; + private long invokeTime; // ====================查询辅助参数=================== /** @@ -125,7 +125,7 @@ public void setId(String id) { this.id = id; } - public Long getTimeParticle() { + public long getTimeParticle() { return timeParticle; } @@ -174,27 +174,27 @@ public void setElapsed(double elapsed) { this.elapsed = elapsed; } - public double getConcurrent() { + public int getConcurrent() { return concurrent; } - public void setConcurrent(double concurrent) { + public void setConcurrent(int concurrent) { this.concurrent = concurrent; } - public double getMaxElapsed() { + public int getMaxElapsed() { return maxElapsed; } - public void setMaxElapsed(double maxElapsed) { + public void setMaxElapsed(int maxElapsed) { this.maxElapsed = maxElapsed; } - public double getMaxConcurrent() { + public int getMaxConcurrent() { return maxConcurrent; } - public void setMaxConcurrent(double maxConcurrent) { + public void setMaxConcurrent(int maxConcurrent) { this.maxConcurrent = maxConcurrent; } @@ -202,11 +202,11 @@ public void setTimeParticle(long timeParticle) { this.timeParticle = timeParticle; } - public double getInvokeTime() { + public long getInvokeTime() { return invokeTime; } - public void setInvokeTime(double invokeTime) { + public void setInvokeTime(long invokeTime) { this.invokeTime = invokeTime; } } diff --git a/src/main/java/com/handu/open/dubbo/monitor/support/CommonResponse.java b/src/main/java/com/handu/open/dubbo/monitor/support/CommonResponse.java index 15de3e1..9cdb15b 100644 --- a/src/main/java/com/handu/open/dubbo/monitor/support/CommonResponse.java +++ b/src/main/java/com/handu/open/dubbo/monitor/support/CommonResponse.java @@ -1,3 +1,18 @@ +/** + * Copyright 2006-2015 handu.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.handu.open.dubbo.monitor.support; import org.springframework.validation.FieldError; diff --git a/src/main/java/com/handu/open/dubbo/monitor/support/UuidUtil.java b/src/main/java/com/handu/open/dubbo/monitor/support/UuidUtil.java index ca5cf46..f6ce879 100644 --- a/src/main/java/com/handu/open/dubbo/monitor/support/UuidUtil.java +++ b/src/main/java/com/handu/open/dubbo/monitor/support/UuidUtil.java @@ -1,3 +1,18 @@ +/** + * Copyright 2006-2015 handu.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.handu.open.dubbo.monitor.support; import java.util.UUID;