Package org.graylog2.plugin

Examples of org.graylog2.plugin.InstantMillisProvider.tick()


        RotationStrategy.Result result;

        result = hourlyRotation.shouldRotate("ignored");
        assertTrue(result.shouldRotate(), "Should rotate the first index");

        clock.tick(seconds(2));

        result = hourlyRotation.shouldRotate("ignored");
        assertTrue(result.shouldRotate(), "Crossed rotation period");

        clock.tick(seconds(2));
View Full Code Here


        clock.tick(seconds(2));

        result = hourlyRotation.shouldRotate("ignored");
        assertTrue(result.shouldRotate(), "Crossed rotation period");

        clock.tick(seconds(2));

        result = hourlyRotation.shouldRotate("ignored");
        assertFalse(result.shouldRotate(), "Did not cross rotation period");
    }
View Full Code Here

        result = tenMinRotation.shouldRotate("ignored");
        assertTrue(result.shouldRotate(), "Should rotate the first index");

        // advance time to 01:55:01
        clock.tick(seconds(1));

        result = tenMinRotation.shouldRotate("ignored");
        assertFalse(result.shouldRotate(), "Did not cross rotation period");

        // advance time to 02:00:00
View Full Code Here

        result = tenMinRotation.shouldRotate("ignored");
        assertFalse(result.shouldRotate(), "Did not cross rotation period");

        // advance time to 02:00:00
        clock.tick(minutes(4).withSeconds(59));

        result = tenMinRotation.shouldRotate("ignored");
        assertTrue(result.shouldRotate(), "Crossed rotation period");

        // advance time multiple rotation periods into the future
View Full Code Here

        result = tenMinRotation.shouldRotate("ignored");
        assertTrue(result.shouldRotate(), "Crossed rotation period");

        // advance time multiple rotation periods into the future
        // to time 02:51:00
        clock.tick(minutes(51));

        result = tenMinRotation.shouldRotate("ignored");
        assertTrue(result.shouldRotate(), "Crossed multiple rotation periods");

        // move time to 2:52:00
View Full Code Here

        result = tenMinRotation.shouldRotate("ignored");
        assertTrue(result.shouldRotate(), "Crossed multiple rotation periods");

        // move time to 2:52:00
        // this should not cycle again, because next valid rotation time is 3:00:00
        clock.tick(minutes(1));
        result = tenMinRotation.shouldRotate("ignored");
        assertFalse(result.shouldRotate(), "Should not cycle when we missed multiple periods");
    }

}
View Full Code Here

            result = aggregator.addChunk(chunk);
            assertTrue(result.isValid());
            assertNull(result.getMessage(), "chunks not complete");
        }
        // move clock forward enough to evict all of the chunks
        clock.tick(Period.seconds(10));

        evictionTask.run();

        final CodecAggregator.Result result = aggregator.addChunk(chunks[0]);
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.