Advertisement
makrusak

Critical bugs in FailureDetector

Mar 14th, 2017
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.48 KB | None | 0 0
  1.   @Test
  2.   public void myTest() {
  3.     FailureDetector fd = new FailureDetector(null, 1, 1000, "normal");
  4.     int from = 0;
  5.     int to = 100;
  6.     for (int i=from;i<to;i++) {
  7.       fd.recordHeartbeat(i);
  8.     }
  9.     double threshold = new GossipSettings().getConvictThreshold();
  10.     double measure = fd.computePhiMeasure(to+2000);
  11.     log.info(threshold);
  12.     log.info(measure);
  13.  
  14.     if (measure > threshold) {
  15.       log.info("DOWN");
  16.     } else {
  17.       log.info("UP");
  18.     }
  19.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement