Package net.anotheria.moskito.core.threshold

Examples of net.anotheria.moskito.core.threshold.Threshold


    td.setProducerName(PaymentCounter.class.getSimpleName());
    td.setIntervalName("1m");
    td.setStatName("cc");
    td.setValueName("counter");

    Threshold tt = ThresholdRepository.getInstance().createThreshold(td);
    tt.addLongGuardLineDownUp(5,5, 10, 15, 20);
    System.out.println(tt);

    //fire the threshold
    IntervalRegistry.getInstance().forceUpdateIntervalForTestingPurposes("1m");
    assertEquals(ThresholdStatus.GREEN, tt.getStatus());

    //force next update
    counter.cc(); counter.cc(); counter.cc();
    counter.cc(); counter.cc(); counter.cc();

    //fire the threshold
    IntervalRegistry.getInstance().forceUpdateIntervalForTestingPurposes("1m");
    assertEquals(ThresholdStatus.YELLOW, tt.getStatus());




  }
View Full Code Here

TOP

Related Classes of net.anotheria.moskito.core.threshold.Threshold

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.