1. Change the parameter name:

Start -> startTimeBucket
End -> endTimeBucket
This commit is contained in:
peng-yongsheng 2018-02-28 21:11:59 +08:00
parent a5216a933a
commit 45a718de46
3 changed files with 11 additions and 11 deletions

View File

@ -65,9 +65,9 @@ public class ServerQuery implements Query {
}
public ResponseTimeTrend getServerResponseTimeTrend(int serverId, Duration duration) throws ParseException {
long start = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getStart());
long end = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getEnd());
return getServerService().getServerResponseTimeTrend(serverId, duration.getStep(), start, end);
long startTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getStart());
long endTimeBucket = DurationUtils.INSTANCE.exchangeToTimeBucket(duration.getEnd());
return getServerService().getServerResponseTimeTrend(serverId, duration.getStep(), startTimeBucket, endTimeBucket);
}
public ThroughputTrend getServerTPSTrend(int serverId, Duration duration) throws ParseException {

View File

@ -92,10 +92,10 @@ public class ServerService {
return serverInfos;
}
public ResponseTimeTrend getServerResponseTimeTrend(int instanceId, Step step, long start,
long end) throws ParseException {
public ResponseTimeTrend getServerResponseTimeTrend(int instanceId, Step step, long startTimeBucket,
long endTimeBucket) throws ParseException {
ResponseTimeTrend responseTimeTrend = new ResponseTimeTrend();
List<DurationPoint> durationPoints = DurationUtils.INSTANCE.getDurationPoints(step, start, end);
List<DurationPoint> durationPoints = DurationUtils.INSTANCE.getDurationPoints(step, startTimeBucket, endTimeBucket);
List<Integer> trends = instanceMetricUIDAO.getResponseTimeTrend(instanceId, step, durationPoints);
responseTimeTrend.setTrendList(trends);
return responseTimeTrend;

View File

@ -139,11 +139,11 @@ public enum DurationUtils {
return dateTime;
}
public List<DurationPoint> getDurationPoints(Step step, long start, long end) throws ParseException {
DateTime dateTime = parseToDateTime(step, start);
public List<DurationPoint> getDurationPoints(Step step, long startTimeBucket, long endTimeBucket) throws ParseException {
DateTime dateTime = parseToDateTime(step, startTimeBucket);
List<DurationPoint> durations = new LinkedList<>();
durations.add(new DurationPoint(start, secondsBetween(step, dateTime)));
durations.add(new DurationPoint(startTimeBucket, secondsBetween(step, dateTime)));
int i = 0;
do {
@ -176,10 +176,10 @@ public enum DurationUtils {
}
i++;
if (i > 500) {
throw new UnexpectedException("Duration data error, step: " + step.name() + ", start: " + start + ", end: " + end);
throw new UnexpectedException("Duration data error, step: " + step.name() + ", start: " + startTimeBucket + ", end: " + endTimeBucket);
}
}
while (end != durations.get(durations.size() - 1).getPoint());
while (endTimeBucket != durations.get(durations.size() - 1).getPoint());
return durations;
}