Examples of DelayStatInfo


Examples of com.alibaba.otter.manager.biz.statistics.delay.param.DelayStatInfo

        Map<Long, DelayStatInfo> delayStatInfos = new LinkedHashMap<Long, DelayStatInfo>();
        List<DelayStatDO> delayStatDOs = delayStatDao.listTimelineDelayStatsByPipelineId(pipelineId, start, end);
        int size = delayStatDOs.size();
        int k = size - 1;
        for (Long i = start.getTime(); i <= end.getTime(); i += 60 * 1000) {
            DelayStatInfo delayStatInfo = new DelayStatInfo();
            List<DelayStat> delayStats = new ArrayList<DelayStat>();
            // 取出每个时间点i以内的数据,k是一个游标,每次遍历时前面已经取过了的数据就不用再遍历了
            for (int j = k; j >= 0; --j) {
                if ((i - delayStatDOs.get(j).getGmtModified().getTime() <= 60 * 1000)
                    && (i - delayStatDOs.get(j).getGmtModified().getTime() >= 0)) {
                    delayStats.add(delayStatDOToModel(delayStatDOs.get(j)));
                    k = j - 1;
                }// 如果不满足if条件,则后面的数据也不用再遍历
                else {
                    break;
                }
            }
            if (delayStats.size() > 0) {
                delayStatInfo.setItems(delayStats);
                delayStatInfos.put(i, delayStatInfo);
            }

        }
        return delayStatInfos;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.