提交 58259141 编写于 作者: P peng-yongsheng

Fixed the Dashboard and Topology bug.

上级 eee27e04
......@@ -72,11 +72,12 @@ public class ApplicationService {
int... applicationIds) {
List<Application> applications = instanceDAO.getApplications(startSecondTimeBucket, endSecondTimeBucket, applicationIds);
applications.forEach(application -> {
for (int i = applications.size() - 1; i >= 0; i--) {
Application application = applications.get(i);
if (application.getId() == Const.NONE_APPLICATION_ID) {
applications.remove(application);
applications.remove(i);
}
});
}
applications.forEach(application -> {
String applicationCode = applicationCacheService.getApplicationById(application.getId()).getApplicationCode();
......@@ -112,7 +113,8 @@ public class ApplicationService {
return applicationThroughput;
}
public ConjecturalAppBrief getConjecturalApps(Step step, long startSecondTimeBucket, long endSecondTimeBucket) throws ParseException {
public ConjecturalAppBrief getConjecturalApps(Step step, long startSecondTimeBucket,
long endSecondTimeBucket) throws ParseException {
List<ConjecturalApp> conjecturalApps = networkAddressUIDAO.getConjecturalApps();
conjecturalApps.forEach(conjecturalApp -> {
String name = ServerTypeDefine.getInstance().getServerType(conjecturalApp.getId());
......
......@@ -53,6 +53,10 @@ class SecondBetweenService {
Date startDate = new SimpleDateFormat("yyyyMMddHHmmss").parse(String.valueOf(startSecondTimeBucket));
Date endDate = new SimpleDateFormat("yyyyMMddHHmmss").parse(String.valueOf(endSecondTimeBucket));
return Seconds.secondsBetween(new DateTime(startDate), new DateTime(endDate)).getSeconds();
int seconds = Seconds.secondsBetween(new DateTime(startDate), new DateTime(endDate)).getSeconds();
if (seconds == 0) {
seconds = 1;
}
return seconds;
}
}
......@@ -25,6 +25,10 @@ public enum ApdexCalculator {
INSTANCE;
public int calculate(long satisfiedCount, long toleratingCount, long frustratedCount) {
return (int)(((satisfiedCount + toleratingCount / 2) * 100) / (satisfiedCount + toleratingCount + frustratedCount));
if (satisfiedCount + toleratingCount + frustratedCount == 0) {
return 100;
} else {
return (int)(((satisfiedCount + toleratingCount / 2) * 100) / (satisfiedCount + toleratingCount + frustratedCount));
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册