double phi(long tnow) { assert arrivalIntervals.mean() > 0 && tLast > 0; // should not be called before any samples arrive long t = tnow - tLast; lastReportedPhi = t / mean(); return lastReportedPhi; }
double phi(long tnow) { assert arrivalIntervals.mean() > 0 && tLast > 0; // should not be called before any samples arrive long t = tnow - tLast; return t / mean(); }
double phi(long tnow) { assert arrivalIntervals.mean() > 0 && tLast > 0; // should not be called before any samples arrive long t = tnow - tLast; lastReportedPhi = t / mean(); return lastReportedPhi; }
double phi(long tnow) { assert arrivalIntervals.mean() > 0 && tLast > 0; // should not be called before any samples arrive long t = tnow - tLast; lastReportedPhi = t / mean(); return lastReportedPhi; }
logger.trace("intervals: {} mean: {}", hbWnd, hbWnd.mean()); for (IFailureDetectionEventListener listener : fdEvntListeners)
public void report(InetAddress ep) { long now = Clock.instance.nanoTime(); ArrivalWindow heartbeatWindow = arrivalSamples.get(ep); if (heartbeatWindow == null) { // avoid adding an empty ArrivalWindow to the Map heartbeatWindow = new ArrivalWindow(SAMPLE_SIZE); heartbeatWindow.add(now, ep); heartbeatWindow = arrivalSamples.putIfAbsent(ep, heartbeatWindow); if (heartbeatWindow != null) heartbeatWindow.add(now, ep); } else { heartbeatWindow.add(now, ep); } if (logger.isTraceEnabled() && heartbeatWindow != null) logger.trace("Average for {} is {}", ep, heartbeatWindow.mean()); }
public void report(InetAddress ep) { long now = Clock.instance.nanoTime(); ArrivalWindow heartbeatWindow = arrivalSamples.get(ep); if (heartbeatWindow == null) { // avoid adding an empty ArrivalWindow to the Map heartbeatWindow = new ArrivalWindow(SAMPLE_SIZE); heartbeatWindow.add(now, ep); heartbeatWindow = arrivalSamples.putIfAbsent(ep, heartbeatWindow); if (heartbeatWindow != null) heartbeatWindow.add(now, ep); } else { heartbeatWindow.add(now, ep); } if (logger.isTraceEnabled() && heartbeatWindow != null) logger.trace("Average for {} is {}", ep, heartbeatWindow.mean()); }
public void report(InetAddress ep) { long now = Clock.instance.nanoTime(); ArrivalWindow heartbeatWindow = arrivalSamples.get(ep); if (heartbeatWindow == null) { // avoid adding an empty ArrivalWindow to the Map heartbeatWindow = new ArrivalWindow(SAMPLE_SIZE); heartbeatWindow.add(now, ep); heartbeatWindow = arrivalSamples.putIfAbsent(ep, heartbeatWindow); if (heartbeatWindow != null) heartbeatWindow.add(now, ep); } else { heartbeatWindow.add(now, ep); } if (logger.isTraceEnabled() && heartbeatWindow != null) logger.trace("Average for {} is {}", ep, heartbeatWindow.mean()); }
@Override public TabularData getPhiValues() throws OpenDataException { final CompositeType ct = new CompositeType("Node", "Node", new String[]{"Endpoint", "PHI"}, new String[]{"IP of the endpoint", "PHI value"}, new OpenType[]{SimpleType.STRING, SimpleType.DOUBLE}); final TabularDataSupport results = new TabularDataSupport(new TabularType("PhiList", "PhiList", ct, new String[]{"Endpoint"})); for (final Map.Entry<InetAddress, ArrivalWindow> entry : arrivalSamples.entrySet()) { final ArrivalWindow window = entry.getValue(); if (window.mean() > 0) { final double phi = window.getLastReportedPhi(); if (phi != Double.MIN_VALUE) { // returned values are scaled by PHI_FACTOR so that the are on the same scale as PhiConvictThreshold final CompositeData data = new CompositeDataSupport(ct, new String[]{"Endpoint", "PHI"}, new Object[]{entry.getKey().toString(), phi * PHI_FACTOR}); results.put(data); } } } return results; }
@Override public TabularData getPhiValues() throws OpenDataException { final CompositeType ct = new CompositeType("Node", "Node", new String[]{"Endpoint", "PHI"}, new String[]{"IP of the endpoint", "PHI value"}, new OpenType[]{SimpleType.STRING, SimpleType.DOUBLE}); final TabularDataSupport results = new TabularDataSupport(new TabularType("PhiList", "PhiList", ct, new String[]{"Endpoint"})); for (final Map.Entry<InetAddress, ArrivalWindow> entry : arrivalSamples.entrySet()) { final ArrivalWindow window = entry.getValue(); if (window.mean() > 0) { final double phi = window.getLastReportedPhi(); if (phi != Double.MIN_VALUE) { // returned values are scaled by PHI_FACTOR so that the are on the same scale as PhiConvictThreshold final CompositeData data = new CompositeDataSupport(ct, new String[]{"Endpoint", "PHI"}, new Object[]{entry.getKey().toString(), phi * PHI_FACTOR}); results.put(data); } } } return results; }
@Override public TabularData getPhiValues() throws OpenDataException { final CompositeType ct = new CompositeType("Node", "Node", new String[]{"Endpoint", "PHI"}, new String[]{"IP of the endpoint", "PHI value"}, new OpenType[]{SimpleType.STRING, SimpleType.DOUBLE}); final TabularDataSupport results = new TabularDataSupport(new TabularType("PhiList", "PhiList", ct, new String[]{"Endpoint"})); for (final Map.Entry<InetAddress, ArrivalWindow> entry : arrivalSamples.entrySet()) { final ArrivalWindow window = entry.getValue(); if (window.mean() > 0) { final double phi = window.getLastReportedPhi(); if (phi != Double.MIN_VALUE) { // returned values are scaled by PHI_FACTOR so that the are on the same scale as PhiConvictThreshold final CompositeData data = new CompositeDataSupport(ct, new String[]{"Endpoint", "PHI"}, new Object[]{entry.getKey().toString(), phi * PHI_FACTOR}); results.put(data); } } } return results; }