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

Change the attribute name from responseTimePerSec to avgResponseTime.

上级 7ce2ac5a
......@@ -27,7 +27,7 @@ public class ApplicationNode extends Node {
private int sla;
private long callsPerSec;
private long responseTimePerSec;
private long avgResponseTime;
private int apdex;
private boolean isAlarm;
private int numOfServer;
......@@ -50,12 +50,12 @@ public class ApplicationNode extends Node {
this.callsPerSec = callsPerSec;
}
public long getResponseTimePerSec() {
return responseTimePerSec;
public long getAvgResponseTime() {
return avgResponseTime;
}
public void setResponseTimePerSec(long responseTimePerSec) {
this.responseTimePerSec = responseTimePerSec;
public void setAvgResponseTime(long avgResponseTime) {
this.avgResponseTime = avgResponseTime;
}
public int getApdex() {
......
......@@ -28,10 +28,8 @@ public class Call {
private String targetName;
private boolean isAlert;
private String callType;
private long calls;
private long callsPerSec;
private long responseTimes;
private long responseTimePerSec;
private long avgResponseTime;
public int getSource() {
return source;
......@@ -81,14 +79,6 @@ public class Call {
this.callType = callType;
}
public long getCalls() {
return calls;
}
public void setCalls(long calls) {
this.calls = calls;
}
public long getCallsPerSec() {
return callsPerSec;
}
......@@ -97,19 +87,11 @@ public class Call {
this.callsPerSec = callsPerSec;
}
public long getResponseTimes() {
return responseTimes;
}
public void setResponseTimes(long responseTimes) {
this.responseTimes = responseTimes;
}
public long getResponseTimePerSec() {
return responseTimePerSec;
public long getAvgResponseTime() {
return avgResponseTime;
}
public void setResponseTimePerSec(long responseTimePerSec) {
this.responseTimePerSec = responseTimePerSec;
public void setAvgResponseTime(long avgResponseTime) {
this.avgResponseTime = avgResponseTime;
}
}
......@@ -177,8 +177,8 @@ public class ServiceReferenceEsMetricUIDAO extends EsDAO implements IServiceRefe
Call call = new Call();
call.setSource(frontServiceId);
call.setTarget(behindServiceId);
call.setCalls((int)callsSum.getValue());
call.setResponseTimes((int)responseTimes.getValue());
// call.setCalls((int)callsSum.getValue());
// call.setResponseTimes((int)responseTimes.getValue());
calls.add(call);
});
}
......@@ -192,8 +192,8 @@ public class ServiceReferenceEsMetricUIDAO extends EsDAO implements IServiceRefe
Call call = new Call();
call.setTarget(behindServiceId);
call.setSource(frontServiceId);
call.setCalls((int)callsSum.getValue());
call.setResponseTimes((int)responseTimes.getValue());
// call.setCalls((int)callsSum.getValue());
// call.setResponseTimes((int)responseTimes.getValue());
calls.add(call);
});
}
......
......@@ -117,7 +117,7 @@ public class ApplicationTopologyService {
// long calls = call.getCalls();
// long responseTimes = call.getResponseTimes();
// call.setCallsPerSec(calls / secondsBetween);
// call.setResponseTimePerSec(responseTimes / secondsBetween);
// call.setAvgResponseTime(responseTimes / secondsBetween);
// });
return null;
}
......
......@@ -62,8 +62,8 @@ class TopologyBuilder {
calleeReferenceMetric = calleeReferenceMetricFilter(calleeReferenceMetric);
List<Node> nodes = new LinkedList<>();
applicationMetrics.forEach(node -> {
int id = node.getId();
applicationMetrics.forEach(applicationMetric -> {
int id = applicationMetric.getId();
Application application = applicationCacheService.getApplicationById(id);
ApplicationNode applicationNode = new ApplicationNode();
applicationNode.setId(id);
......@@ -72,7 +72,7 @@ class TopologyBuilder {
applicationNode.setSla(10);
applicationNode.setCallsPerSec(100L);
applicationNode.setResponseTimePerSec(100L);
applicationNode.setAvgResponseTime((applicationMetric.getDurations() - applicationMetric.getErrorDurations()) / (applicationMetric.getCalls() - applicationMetric.getErrorCalls()));
applicationNode.setApdex(10);
applicationNode.setAlarm(false);
applicationNode.setNumOfServer(1);
......@@ -104,7 +104,7 @@ class TopologyBuilder {
call.setAlert(true);
call.setCallType(components.get(referenceMetric.getTarget()));
call.setCallsPerSec(1);
call.setResponseTimePerSec(1);
call.setAvgResponseTime((referenceMetric.getDurations() - referenceMetric.getErrorDurations()) / (referenceMetric.getCalls() - referenceMetric.getErrorCalls()));
calls.add(call);
});
......@@ -141,7 +141,7 @@ class TopologyBuilder {
call.setCallType(components.get(referenceMetric.getTarget()));
}
call.setCallsPerSec(1);
call.setResponseTimePerSec(1);
call.setAvgResponseTime((referenceMetric.getDurations() - referenceMetric.getErrorDurations()) / (referenceMetric.getCalls() - referenceMetric.getErrorCalls()));
calls.add(call);
});
......
......@@ -10,7 +10,7 @@ type ApplicationNode implements Node {
# The number of incoming calls
callsPerSec: Long!
# Unit: millisecond
responseTimePerSec: Long!
avgResponseTime: Long!
# ref: http://www.apdex.org/
# Max value is 100
# 2 Digits after floating point in UI, need to division by 100. 100 -> 1.00
......
......@@ -106,5 +106,5 @@ type Call {
callType: String!
callsPerSec: Long!
# Unit: millisecond
responseTimePerSec: Long!
avgResponseTime: Long!
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册