/** * Time when statistics was last reset for this leaf endpoint * @return the time when statistics was last reset for this leaf endpoint, or -1 for group endpoints */ public long getLastResetTime() { return (endpoint.getChildren() != null ? -1 : lastResetTime); }
/** * Time when statistics was last reset for this leaf endpoint * @return the time when statistics was last reset for this leaf endpoint, or -1 for group endpoints */ public long getLastResetTime() { return (endpoint.getChildren() != null ? -1 : lastResetTime); }
@Override public List<Endpoint> getChildren() { return realEndpoint.getChildren(); }
@Override public List<Endpoint> getChildren() { return realEndpoint.getChildren(); }
/** * Return number of children for this endpoint * @return the number of children for this endpoint * @throws Exception */ public int getTotalChildren() throws Exception { return (endpoint.getChildren() == null ? 0 : endpoint.getChildren().size()); }
/** * Return number of children for this endpoint * @return the number of children for this endpoint * @throws Exception */ public int getTotalChildren() throws Exception { return (endpoint.getChildren() == null ? 0 : endpoint.getChildren().size()); }
/** * Time since statistics was last reset for this leaf endpoint * @return the time since statistics was last reset for this leaf endpoint, or -1 for group endpoints */ public long getMetricsWindow() { return (endpoint.getChildren() != null ? -1 : System.currentTimeMillis() - lastResetTime); }
/** * Time since statistics was last reset for this leaf endpoint * @return the time since statistics was last reset for this leaf endpoint, or -1 for group endpoints */ public long getMetricsWindow() { return (endpoint.getChildren() != null ? -1 : System.currentTimeMillis() - lastResetTime); }
/** * Number of timeouts, receiving replies * @return # of timeouts, receiving replies */ public long getTimeoutsReceiving() { if (endpoint.getChildren() != null) { long timeoutsReceiving = 0; for (Endpoint e : endpoint.getChildren()) { if (e.getMetricsMBean() != null) { timeoutsReceiving += e.getMetricsMBean().getTimeoutsReceiving(); } } return timeoutsReceiving; } else { return timeoutsReceiving; } }
public double getAvgSizeSent() { if (endpoint.getChildren() != null) { double avgSizeSent = 0; for (Endpoint e : endpoint.getChildren()) { double epValue = e.getMetricsMBean() == null ? 0 : e.getMetricsMBean().getAvgSizeSent(); if (epValue > 0) { avgSizeSent = (avgSizeSent == 0 ? epValue : (avgSizeSent + epValue) / 2); } } return avgSizeSent; } else { return avgSizeSent; } }
public double getAvgSizeSent() { if (endpoint.getChildren() != null) { double avgSizeSent = 0; for (Endpoint e : endpoint.getChildren()) { double epValue = e.getMetricsMBean() == null ? 0 : e.getMetricsMBean().getAvgSizeSent(); if (epValue > 0) { avgSizeSent = (avgSizeSent == 0 ? epValue : (avgSizeSent + epValue) / 2); } } return avgSizeSent; } else { return avgSizeSent; } }
/** * Number of timeouts, sending * @return # of timeouts, sending */ public long getTimeoutsSending() { if (endpoint.getChildren() != null) { long timeoutsSending = 0; for (Endpoint e : endpoint.getChildren()) { if (e.getMetricsMBean() != null) { timeoutsSending += e.getMetricsMBean().getTimeoutsSending(); } } return timeoutsSending; } else { return timeoutsSending; } }
/** * Number of bytes sent * @return # of bytes sent */ public long getBytesSent() { if (endpoint.getChildren() != null) { long bytesSent = 0; for (Endpoint e : endpoint.getChildren()) { if (e.getMetricsMBean() != null) { bytesSent += e.getMetricsMBean().getBytesSent(); } } return bytesSent; } else { return bytesSent; } }
public double getAvgSizeReceived() { if (endpoint.getChildren() != null) { double avgSizeReceived = 0; for (Endpoint e : endpoint.getChildren()) { double epValue = e.getMetricsMBean() == null ? 0 : e.getMetricsMBean().getAvgSizeReceived(); if (epValue > 0) { avgSizeReceived = (avgSizeReceived == 0 ? epValue : (avgSizeReceived + epValue) / 2); } } return avgSizeReceived; } else { return avgSizeReceived; } }
private void fillMap(List<Endpoint> endpoints, Map<String, Endpoint> endpointsMap) { if (endpoints != null) { for (Endpoint endpoint : endpoints) { String endpointName = getEndpointName(endpoint); if (endpointsMap.containsKey(endpointName)) { handleException("Endpoint Name with ' " + endpointName + "' already there. " + "Endpoint name must be unique."); } endpointsMap.put(endpointName, endpoint); fillMap(endpoint.getChildren(), endpointsMap); } } }
/** * A Map of response codes and counts * @return a Map of response codes and counts */ public Map<Integer, Long> getResponseCodeTable() { if (endpoint.getChildren() != null) { Map<Integer, Long> responseCodeTable = new HashMap<Integer, Long>(); for (Endpoint e : endpoint.getChildren()) { if (e.getMetricsMBean() != null) { addTableMaps(responseCodeTable, e.getMetricsMBean().getResponseCodeTable()); } } return responseCodeTable; } else { return responseCodeTable; } }
private void fillMap(List<Endpoint> endpoints, Map<String, Endpoint> endpointsMap) { if (endpoints != null) { for (Endpoint endpoint : endpoints) { String endpointName = getEndpointName(endpoint); if (endpointsMap.containsKey(endpointName)) { handleException("Endpoint Name with ' " + endpointName + "' already there. " + "Endpoint name must be unique."); } endpointsMap.put(endpointName, endpoint); fillMap(endpoint.getChildren(), endpointsMap); } } }
public long getMaxSizeReceived() { if (endpoint.getChildren() != null) { long maxSizeReceived = 0; for (Endpoint e : endpoint.getChildren()) { if (e.getMetricsMBean() != null) { if (maxSizeReceived == 0) { maxSizeReceived = e.getMetricsMBean().getMaxSizeReceived(); } else if (e.getMetricsMBean().getMaxSizeReceived() > maxSizeReceived) { maxSizeReceived = e.getMetricsMBean().getMaxSizeReceived(); } } } return maxSizeReceived; } else { return maxSizeReceived; } }
/** * Is a leaf level endpoint active? For a group endpoint this means at least one is active * @return true if at least one is active in a group endpoint; for a leaf - if it is currently active * @throws Exception */ public boolean isActive() throws Exception { if (endpoint.getChildren() != null) { return getActiveChildren() > 0; } else if (endpoint.getContext() != null) { return endpoint.getContext().isState(EndpointContext.ST_ACTIVE); } return false; }
/** * Is a leaf level endpoint active? For a group endpoint this means at least one is active * @return true if at least one is active in a group endpoint; for a leaf - if it is currently active * @throws Exception */ public boolean isActive() throws Exception { if (endpoint.getChildren() != null) { return getActiveChildren() > 0; } else if (endpoint.getContext() != null) { return endpoint.getContext().isState(EndpointContext.ST_ACTIVE); } return false; }