Package com.alibaba.otter.shared.common.model.statistics.delay

Examples of com.alibaba.otter.shared.common.model.statistics.delay.DelayCount


        }

    }

    private void sendDelayStat(long pipelineId, Long endTime, Long startTime) {
        DelayCount delayCount = new DelayCount();
        delayCount.setPipelineId(pipelineId);
        delayCount.setNumber(0L);// 不再统计delayNumber
        if (startTime != null && endTime != null) {
            delayCount.setTime(endTime - startTime);// 以后改造成获取数据库的sysdate/now()
        }

        statisticsClientService.sendResetDelayCount(delayCount);
    }
View Full Code Here


    private void sendDelayReset(long pipelineId) {
        long currentTime = System.currentTimeMillis();
        if (currentTime - lastResetTime > 60 * 1000) {
            // 60秒向manager推送一次配置
            lastResetTime = currentTime;
            DelayCount delayCount = new DelayCount();
            delayCount.setPipelineId(pipelineId);
            delayCount.setNumber(0L);
            long delayTime = (new Date().getTime() - otterSelector.lastEntryTime() + 500) / 1000;// 4舍5入
            delayCount.setTime(delayTime);
            statisticsClientService.sendResetDelayCount(delayCount);
        }
    }
View Full Code Here

    public void onDelayCount(DelayCountEvent event) {
        Assert.notNull(event);
        Assert.notNull(event.getCount());

        // 更新delay queue的计数器
        DelayCount count = event.getCount();
        // 构造一次delay stat快照
        DelayStat stat = new DelayStat();
        stat.setPipelineId(count.getPipelineId());
        stat.setDelayNumber(0L); // 不再记录堆积量
        stat.setDelayTime(count.getTime() >= 0 ? count.getTime() : 0); // 只记录延迟时间,负数直接归为0

        if (statUnit <= 0) {
            delayStatService.createDelayStat(stat);
        } else {
            synchronized (delayStats) {
                delayStats.get(count.getPipelineId()).merge(stat);
            }
        }
    }
View Full Code Here

            want.fail();
        }
    }

    private void sendDelayStat() {
        DelayCount count = new DelayCount();
        count.setPipelineId(1L);
        count.setNumber(100L);
        count.setTime(5L);

        statisticsClientService.sendIncDelayCount(count);
        statisticsClientService.sendDecDelayCount(count);
    }
View Full Code Here

    public void onDelayCount(DelayCountEvent event) {
        Assert.notNull(event);
        Assert.notNull(event.getCount());

        // 更新delay queue的计数器
        DelayCount count = event.getCount();
        // 构造一次delay stat快照
        DelayStat stat = new DelayStat();
        stat.setPipelineId(count.getPipelineId());
        stat.setDelayNumber(0L); // 不再记录堆积量
        stat.setDelayTime(count.getTime()); // 只记录延迟时间

        if (statUnit <= 0) {
            delayStatService.createDelayStat(stat);
        } else {
            synchronized (delayStats) {
                delayStats.get(count.getPipelineId()).merge(stat);
            }
        }
    }
View Full Code Here

        }

    }

    private void sendDelayStat(long pipelineId, Long endTime, Long startTime) {
        DelayCount delayCount = new DelayCount();
        delayCount.setPipelineId(pipelineId);
        delayCount.setNumber(0L);// 不再统计delayNumber
        if (startTime != null && endTime != null) {
            delayCount.setTime(endTime - startTime);// 以后改造成获取数据库的sysdate/now()
        }

        statisticsClientService.sendResetDelayCount(delayCount);
    }
View Full Code Here

    private void sendDelayReset(long pipelineId) {
        long currentTime = System.currentTimeMillis();
        if (currentTime - lastResetTime > 60 * 1000) {
            // 60秒向manager推送一次配置
            lastResetTime = currentTime;
            DelayCount delayCount = new DelayCount();
            delayCount.setPipelineId(pipelineId);
            delayCount.setNumber(0L);
            long delayTime = currentTime - otterSelector.lastEntryTime();
            delayCount.setTime(delayTime);
            statisticsClientService.sendResetDelayCount(delayCount);
        }
    }
View Full Code Here

        }

    }

    private void sendDelayStat(long pipelineId, Long endTime, Long startTime) {
        DelayCount delayCount = new DelayCount();
        delayCount.setPipelineId(pipelineId);
        delayCount.setNumber(0L);// 不再统计delayNumber
        if (startTime != null && endTime != null) {
            delayCount.setTime(endTime - startTime);// 以后改造成获取数据库的sysdate/now()
        }

        statisticsClientService.sendResetDelayCount(delayCount);
    }
View Full Code Here

    private void sendDelayReset(long pipelineId) {
        long currentTime = System.currentTimeMillis();
        if (currentTime - lastResetTime > 60 * 1000) {
            // 60秒向manager推送一次配置
            lastResetTime = currentTime;
            DelayCount delayCount = new DelayCount();
            delayCount.setPipelineId(pipelineId);
            delayCount.setNumber(0L);
            long delayTime = currentTime - otterSelector.lastEntryTime();
            delayCount.setTime(delayTime);
            statisticsClientService.sendResetDelayCount(delayCount);
        }
    }
View Full Code Here

TOP

Related Classes of com.alibaba.otter.shared.common.model.statistics.delay.DelayCount

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.