Examples of ThroughputStat


Examples of com.alibaba.otter.shared.common.model.statistics.throughput.ThroughputStat

    }

    public ThroughputStat findThroughputStatByPipelineId(ThroughputCondition condition) {
        Assert.assertNotNull(condition);
        ThroughputStatDO throughputStatDO = throughputDao.findRealtimeThroughputStat(condition);
        ThroughputStat throughputStat = new ThroughputStat();
        if (throughputStatDO != null) {
            throughputStat = throughputStatDOToModel(throughputStatDO);
        }
        return throughputStat;
    }
View Full Code Here

Examples of com.alibaba.otter.shared.common.model.statistics.throughput.ThroughputStat

     *
     * @param throughputStatDO
     * @return throughputStat
     */
    private ThroughputStat throughputStatDOToModel(ThroughputStatDO throughputStatDO) {
        ThroughputStat throughputStat = new ThroughputStat();
        throughputStat.setId(throughputStatDO.getId());
        throughputStat.setPipelineId(throughputStatDO.getPipelineId());
        throughputStat.setStartTime(throughputStatDO.getStartTime());
        throughputStat.setEndTime(throughputStatDO.getEndTime());
        throughputStat.setType(throughputStatDO.getType());
        throughputStat.setNumber(throughputStatDO.getNumber());
        throughputStat.setSize(throughputStatDO.getSize());
        throughputStat.setGmtCreate(throughputStatDO.getGmtCreate());
        throughputStat.setGmtModified(throughputStatDO.getGmtModified());
        return throughputStat;
    }
View Full Code Here

Examples of com.alibaba.otter.shared.common.model.statistics.throughput.ThroughputStat

            }
        } else {
            synchronized (throughputStats) {
                for (ThroughputStat stat : event.getStats()) {
                    Map<ThroughputType, ThroughputStat> data = throughputStats.get(stat.getPipelineId());
                    ThroughputStat old = data.get(stat.getType());
                    if (old != null) {
                        //执行合并
                        old.setNumber(stat.getNumber() + old.getNumber());
                        old.setSize(stat.getSize() + old.getSize());
                        if (stat.getEndTime().after(old.getEndTime())) {
                            old.setEndTime(stat.getEndTime());
                        }

                        if (stat.getStartTime().before(old.getStartTime())) {
                            old.setStartTime(stat.getStartTime());
                        }
                    } else {
                        data.put(stat.getType(), stat);
                    }
                }
View Full Code Here

Examples of com.alibaba.otter.shared.common.model.statistics.throughput.ThroughputStat

    }

    private void sendThroughputs() {
        Date now = new Date();

        ThroughputStat rowStat = new ThroughputStat();
        rowStat.setType(ThroughputType.ROW);
        rowStat.setStartTime(new Date(now.getTime() - 600 * 1000L));
        rowStat.setEndTime(now);
        rowStat.setPipelineId(1L);
        rowStat.setNumber(100L);
        rowStat.setSize(100L);

        ThroughputStat fileStat = new ThroughputStat();
        fileStat.setType(ThroughputType.FILE);
        fileStat.setStartTime(new Date(now.getTime() - 800 * 1000L));
        fileStat.setEndTime(now);
        fileStat.setPipelineId(1L);
        fileStat.setNumber(101L);
        fileStat.setSize(101L);

        statisticsClientService.sendThroughputs(Arrays.asList(rowStat, fileStat));
    }
View Full Code Here

Examples of com.alibaba.otter.shared.common.model.statistics.throughput.ThroughputStat

            }
        } else {
            synchronized (throughputStats) {
                for (ThroughputStat stat : event.getStats()) {
                    Map<ThroughputType, ThroughputStat> data = throughputStats.get(stat.getPipelineId());
                    ThroughputStat old = data.get(stat.getType());
                    if (old != null) {
                        //执行合并
                        old.setNumber(stat.getNumber() + old.getNumber());
                        old.setSize(stat.getSize() + old.getSize());
                        if (stat.getEndTime().after(old.getEndTime())) {
                            old.setEndTime(stat.getEndTime());
                        }

                        if (stat.getStartTime().before(stat.getStartTime())) {
                            stat.setStartTime(stat.getStartTime());
                        }
View Full Code Here

Examples of com.alibaba.otter.shared.common.model.statistics.throughput.ThroughputStat

        }

        List<ThroughputStat> throughputStats = new ArrayList<ThroughputStat>();
        if (!(rowCount == 0 && rowSize == 0)) {
            // 处理Throughput stat
            ThroughputStat rowThroughputStat = new ThroughputStat();
            rowThroughputStat.setType(ThroughputType.ROW);
            rowThroughputStat.setPipelineId(identity.getPipelineId());
            rowThroughputStat.setNumber(rowCount);
            rowThroughputStat.setSize(rowSize);
            rowThroughputStat.setStartTime(new Date(throughput.getStartTime()));
            rowThroughputStat.setEndTime(endTime);
            throughputStats.add(rowThroughputStat);
        }
        if (!(fileCount == 0 && fileSize == 0)) {
            ThroughputStat fileThroughputStat = new ThroughputStat();
            fileThroughputStat.setType(ThroughputType.FILE);
            fileThroughputStat.setPipelineId(identity.getPipelineId());
            fileThroughputStat.setNumber(fileCount);
            fileThroughputStat.setSize(fileSize);
            fileThroughputStat.setStartTime(new Date(throughput.getStartTime()));
            fileThroughputStat.setEndTime(endTime);
            throughputStats.add(fileThroughputStat);
        }

        // add by 2012-07-06 for mq loader
        if (!(mqCount == 0 && mqSize == 0)) {
            ThroughputStat mqThroughputStat = new ThroughputStat();
            mqThroughputStat.setType(ThroughputType.MQ);
            mqThroughputStat.setPipelineId(identity.getPipelineId());
            mqThroughputStat.setNumber(mqCount);
            mqThroughputStat.setSize(mqSize);
            mqThroughputStat.setStartTime(new Date(throughput.getStartTime()));
            mqThroughputStat.setEndTime(endTime);
            throughputStats.add(mqThroughputStat);
        }

        if (!CollectionUtils.isEmpty(throughputStats)) {
            statisticsClientService.sendThroughputs(throughputStats);
View Full Code Here

Examples of com.alibaba.otter.shared.common.model.statistics.throughput.ThroughputStat

        condition11.setType(ThroughputType.FILE);
        condition22.setPipelineId(pipelineId);
        condition22.setType(ThroughputType.ROW);
        Map<AnalysisType, ThroughputInfo> throughputInfos1 = throughputStatService.listRealtimeThroughput(condition1);
        Map<AnalysisType, ThroughputInfo> throughputInfos2 = throughputStatService.listRealtimeThroughput(condition2);
        ThroughputStat throughputStat1 = throughputStatService.findThroughputStatByPipelineId(condition11);
        ThroughputStat throughputStat2 = throughputStatService.findThroughputStatByPipelineId(condition22);

        context.put("throughputInfos1", throughputInfos1);
        context.put("throughputInfos2", throughputInfos2);
        context.put("channel", channel);
        context.put("pipelineId", pipelineId);
View Full Code Here

Examples of com.alibaba.otter.shared.common.model.statistics.throughput.ThroughputStat

            delayStats.put(pipeline.getId(), delayStat);
            mainstemDatas.put(pipeline.getId(), arbitrateViewService.mainstemData(channel.getId(), pipeline.getId()));
            ThroughputCondition condition = new ThroughputCondition();
            condition.setPipelineId(pipeline.getId());
            condition.setType(ThroughputType.ROW);
            ThroughputStat throughputStat = throughputStatService.findThroughputStatByPipelineId(condition);
            throughputStats.put(pipeline.getId(), throughputStat);
            List<AlarmRule> alarmRules = alarmRuleService.getAlarmRules(pipeline.getId());
            alarmRuleStats.put(pipeline.getId(), alarmRules);
            PositionEventData positionData = arbitrateViewService.getCanalCursor(pipeline.getParameters().getDestinationName(),
                                                                                 pipeline.getParameters().getMainstemClientId());
View Full Code Here

Examples of com.alibaba.otter.shared.common.model.statistics.throughput.ThroughputStat

                // 判断channel状态,只有启动状态才进行判断超时时间
                if (!channel.getStatus().isStop()) {
                    ThroughputCondition condition = new ThroughputCondition();
                    condition.setPipelineId(pipelineId);
                    condition.setType(ThroughputType.ROW);
                    ThroughputStat throughputStat = throughputStatService.findThroughputStatByPipelineId(condition);

                    if (null != throughputStat.getGmtModified()) {
                        Date now = new Date();
                        long time = now.getTime() - throughputStat.getGmtModified().getTime();
                        logger.info("timeout == " + time + "(ms)");

                        long timeout_min = MAX_TIMEOUT; // 单位为分钟
                        if (timeoutMap.containsKey(pipelineId)) {
                            timeout_min = timeoutMap.get(pipelineId);
View Full Code Here

Examples of com.alibaba.otter.shared.common.model.statistics.throughput.ThroughputStat

        Long pipelineId = rules.get(0).getPipelineId();

        ThroughputCondition condition = new ThroughputCondition();
        condition.setPipelineId(pipelineId);
        condition.setType(ThroughputType.ROW);
        ThroughputStat stat = throughputStatService.findThroughputStatByPipelineId(condition);

        long latestSyncTime = 0L;
        if (stat != null && stat.getGmtModified() != null) {
            Date modifiedDate = stat.getGmtModified();
            latestSyncTime = modifiedDate.getTime();
        }
        long now = System.currentTimeMillis();
        long elapsed = now - latestSyncTime;
        boolean flag = false;
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.