Package org.fishwife.jrugged

Examples of org.fishwife.jrugged.PerformanceMonitor.invoke()


        PerformanceMonitor perfMon = new PerformanceMonitor();
        final FixedDelayPerformer performer = new FixedDelayPerformer(50L);

        long startDelay = System.currentTimeMillis();
        for(int i=0; i<500; i++) {
            perfMon.invoke(performer);
        }
        long endDelay = System.currentTimeMillis();

        long start = System.currentTimeMillis();
        for(int i=0; i<500; i++) {
View Full Code Here


        final OccasionalExceptionPerformer performer =
                new OccasionalExceptionPerformer(numberOfAttemptsBeforeThrowingException);

        for(int i=0; i<numberOfTimesToTryAMethodCall; i++) {
            try {
                perfMon.invoke(performer);
            } catch (Exception e) {
                //ignore me.
            }
        }
View Full Code Here

        long begin = System.currentTimeMillis();
        int counter = 0;
        // 60 seconds
        while (System.currentTimeMillis() - begin < 60000) {
            counter++;
            perfMon.invoke(performer);
        }

        System.out.println("Counter: " + counter);
        System.out.println("Success rate last minute: "
               + perfMon.getSuccessRequestsPerSecondLastMinute());
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.