@Test public void testTrackDelayedAggregatedMetricsTenant() { tracker.setIsTrackingDelayedMetrics(); List<String> delayedMetricNames = new ArrayList<String>() {{ for ( Metric metric : delayedMetrics ) { add(metric.getLocator().toString()); } }}; long ingestTime = System.currentTimeMillis(); tracker.trackDelayedAggregatedMetricsTenant(tenantId, delayedMetrics.get(0).getCollectionTime(), ingestTime, delayedMetricNames); verify(loggerMock, atLeastOnce()).info("[TRACKER] Tracking delayed metrics started"); verify(loggerMock, atLeastOnce()).info("[TRACKER][DELAYED METRIC] Tenant sending delayed metrics " + tenantId); verify(loggerMock, atLeastOnce()).info(contains("[TRACKER][DELAYED METRIC] " + tenantId + ".delayed.metric1" + "," + tenantId + ".delayed.metric2 have collectionTime 2016-01-01 00:00:00 which is delayed")); }
public void trackDelayedAggregatedMetricsTenant(String tenantId, long collectionTimeMs, long delayTimeMs, List<String> delayedMetricNames) { if (isTrackingDelayedMetrics) { String logMessage = String.format("[TRACKER][DELAYED METRIC] Tenant sending delayed metrics %s", tenantId); log.info(logMessage); double delayMin = delayTimeMs / 1000 / 60; logMessage = String.format("[TRACKER][DELAYED METRIC] %s have collectionTime %s which is delayed by %.2f minutes", StringUtils.join(delayedMetricNames, ","), dateFormatter.format(new Date(collectionTimeMs)), delayMin); log.info(logMessage); } }
Tracker implements TrackerMBean { public void trackDelayedAggregatedMetricsTenant(String tenantId, long collectionTimeMs, long delayTimeMs, List<String> delayedMetricNames) { if (isTrackingDelayedMetrics) { String logMessage = String.format("[TRACKER][DELAYED METRIC] Tenant sending delayed metrics %s", tenantId); log.info(logMessage); double delayMin = delayTimeMs / 1000 / 60; logMessage = String.format("[TRACKER][DELAYED METRIC] %s have collectionTime %s which is delayed by %.2f minutes", StringUtils.join(delayedMetricNames, ","), dateFormatter.format(new Date(collectionTimeMs)), delayMin); log.info(logMessage); } } }
Tracker implements TrackerMBean { public void trackDelayedAggregatedMetricsTenant(String tenantId, long collectionTimeMs, long delayTimeMs, List<String> delayedMetricNames) { if (isTrackingDelayedMetrics) { String logMessage = String.format("[TRACKER][DELAYED METRIC] Tenant sending delayed metrics %s", tenantId); log.info(logMessage); double delayMin = delayTimeMs / 1000 / 60; logMessage = String.format("[TRACKER][DELAYED METRIC] %s have collectionTime %s which is delayed by %.2f minutes", StringUtils.join(delayedMetricNames, ","), dateFormatter.format(new Date(collectionTimeMs)), delayMin); log.info(logMessage); } } private  Tracker(); }
Tracker implements TrackerMBean { public void trackDelayedAggregatedMetricsTenant(String tenantId, long collectionTimeMs, long delayTimeMs, List<String> delayedMetricNames) { if (isTrackingDelayedMetrics) { String logMessage = String.format("[TRACKER][DELAYED METRIC] Tenant sending delayed metrics %s", tenantId); log.info(logMessage); double delayMin = delayTimeMs / 1000 / 60; logMessage = String.format("[TRACKER][DELAYED METRIC] %s have collectionTime %s which is delayed by %.2f minutes", StringUtils.join(delayedMetricNames, ","), dateFormatter.format(new Date(collectionTimeMs)), delayMin); log.info(logMessage); } } private  Tracker(); static Tracker getInstance(); synchronized void register(); void addTenant(String tenantId); void removeTenant(String tenantId); void removeAllTenants(); Set getTenants(); void addMetricName(String metricName); void removeMetricName(String metricName); void removeAllMetricNames(); Set<String> getMetricNames(); void setIsTrackingDelayedMetrics(); void resetIsTrackingDelayedMetrics(); boolean getIsTrackingDelayedMetrics(); boolean isTracking(String tenantId); boolean doesMessageContainMetricNames(String logmessage); void track(HttpRequest request); void trackResponse(HttpRequest request, FullHttpResponse response); void trackDelayedMetricsTenant(String tenantid, final List<Metric> delayedMetrics); void trackDelayedAggregatedMetricsTenant(String tenantId, long collectionTimeMs, long delayTimeMs, List<String> delayedMetricNames); }
Tracker implements TrackerMBean { public void trackDelayedAggregatedMetricsTenant(String tenantId, long collectionTimeMs, long delayTimeMs, List<String> delayedMetricNames) { if (isTrackingDelayedMetrics) { String logMessage = String.format("[TRACKER][DELAYED METRIC] Tenant sending delayed metrics %s", tenantId); log.info(logMessage); double delayMin = delayTimeMs / 1000 / 60; logMessage = String.format("[TRACKER][DELAYED METRIC] %s have collectionTime %s which is delayed by %.2f minutes", StringUtils.join(delayedMetricNames, ","), dateFormatter.format(new Date(collectionTimeMs)), delayMin); log.info(logMessage); } } private  Tracker(); static Tracker getInstance(); synchronized void register(); void addTenant(String tenantId); void removeTenant(String tenantId); void removeAllTenants(); Set getTenants(); void addMetricName(String metricName); void removeMetricName(String metricName); void removeAllMetricNames(); Set<String> getMetricNames(); void setIsTrackingDelayedMetrics(); void resetIsTrackingDelayedMetrics(); boolean getIsTrackingDelayedMetrics(); boolean isTracking(String tenantId); boolean doesMessageContainMetricNames(String logmessage); void track(HttpRequest request); void trackResponse(HttpRequest request, FullHttpResponse response); void trackDelayedMetricsTenant(String tenantid, final List<Metric> delayedMetrics); void trackDelayedAggregatedMetricsTenant(String tenantId, long collectionTimeMs, long delayTimeMs, List<String> delayedMetricNames); static final String trackerName; }