Package com.alibaba.otter.manager.biz.statistics.throughput.param

Examples of com.alibaba.otter.manager.biz.statistics.throughput.param.ThroughputInfo


        timelineCondition.setType(condition.getType());
        timelineCondition.setStart(new Date(realtime.getTime() - condition.getMax() * 60 * 1000));
        timelineCondition.setEnd(realtime);
        List<ThroughputStatDO> throughputStatDOs = throughputDao.listTimelineThroughputStat(timelineCondition);
        for (AnalysisType analysisType : condition.getAnalysisType()) {
            ThroughputInfo throughputInfo = new ThroughputInfo();
            List<ThroughputStat> throughputStat = new ArrayList<ThroughputStat>();
            for (ThroughputStatDO throughputStatDO : throughputStatDOs) {
                if (realtime.getTime() - throughputStatDO.getEndTime().getTime() <= analysisType.getValue() * 60 * 1000) {
                    throughputStat.add(throughputStatDOToModel(throughputStatDO));
                }
            }
            throughputInfo.setItems(throughputStat);
            throughputInfo.setSeconds(analysisType.getValue() * 60L);
            throughputInfos.put(analysisType, throughputInfo);
        }
        return throughputInfos;

    }
View Full Code Here


        Map<Long, ThroughputInfo> throughputInfos = new LinkedHashMap<Long, ThroughputInfo>();
        List<ThroughputStatDO> throughputStatDOs = throughputDao.listTimelineThroughputStat(condition);
        int size = throughputStatDOs.size();
        int k = size - 1;
        for (Long i = condition.getStart().getTime(); i <= condition.getEnd().getTime(); i += 60 * 1000) {
            ThroughputInfo throughputInfo = new ThroughputInfo();
            List<ThroughputStat> throughputStat = new ArrayList<ThroughputStat>();
            // 取出每个时间点i以内的数据,k是一个游标,每次遍历时前面已经取过了的数据就不用再遍历了
            for (int j = k; j >= 0; --j) {
                if ((i - throughputStatDOs.get(j).getEndTime().getTime() <= 60 * 1000)
                    && (i - throughputStatDOs.get(j).getEndTime().getTime() >= 0)) {
                    throughputStat.add(throughputStatDOToModel(throughputStatDOs.get(j)));
                    k = j - 1;
                }// 如果不满足if条件,则后面的数据也不用再遍历
                else {
                    break;
                }
            }
            if (throughputStat.size() > 0) {
                throughputInfo.setItems(throughputStat);
                throughputInfo.setSeconds(1 * 60L);
                throughputInfos.put(i, throughputInfo);
            }

        }
        return throughputInfos;
View Full Code Here

TOP

Related Classes of com.alibaba.otter.manager.biz.statistics.throughput.param.ThroughputInfo

Copyright © 2018 www.massapicom. 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.