Package com.dianping.cat.message.io

Examples of com.dianping.cat.message.io.DefaultMessageQueue.offer()


    long now = System.currentTimeMillis();
    int num = 10000;
    DefaultMessageQueue queue = new DefaultMessageQueue(num);

    for (int i = 0; i < num; i++) {
      queue.offer(newMessageTree(i, now + i * 10L));
    }

    MessageAnalyzer analyzer = manager.getAnalyzer("dump", now);

    analyzer.analyze(queue);
View Full Code Here


    Assert.assertEquals(true, analyzer.isActive());
    Assert.assertEquals(true, analyzer.isTimeout());

    int count = 2000;
    for (int i = 0; i < count; i++) {
      queue.offer(new DefaultMessageTree());
    }

    analyzer.analyze(queue);

    Assert.assertEquals(Math.min(queueSize, count), analyzer.m_count);
View Full Code Here

    Assert.assertEquals(true, analyzer.isActive());
    Assert.assertEquals(false, analyzer.isTimeout());

    int count = 1000;
    for (int i = 0; i < count; i++) {
      queue.offer(new DefaultMessageTree());
    }
    Threads.forGroup().start(new ShutDown(analyzer));

    analyzer.analyze(queue);
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.