From 222b01d1d738bbf6718b5934e61ada21e755c8d1 Mon Sep 17 00:00:00 2001 From: Dhrubajyoti Sadhu Date: Wed, 23 Aug 2023 18:09:24 +0100 Subject: [PATCH] refactored the code --- .../WaggleDanceIntegrationTest.java | 20 +++---------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/waggle-dance-integration-tests/src/test/java/com/hotels/bdp/waggledance/WaggleDanceIntegrationTest.java b/waggle-dance-integration-tests/src/test/java/com/hotels/bdp/waggledance/WaggleDanceIntegrationTest.java index 08df09557..73afd10b7 100644 --- a/waggle-dance-integration-tests/src/test/java/com/hotels/bdp/waggledance/WaggleDanceIntegrationTest.java +++ b/waggle-dance-integration-tests/src/test/java/com/hotels/bdp/waggledance/WaggleDanceIntegrationTest.java @@ -389,7 +389,7 @@ public void typicalWithGraphite() throws Exception { runner.stop(); Set metrics = new TreeSet<>(Arrays.asList(new String(graphite.getOutput()).split("\n"))); - /*assertMetric(metrics, + assertMetric(metrics, "graphitePrefix.counter.com.hotels.bdp.waggledance.server.FederatedHMSHandler.get_all_databases.all.calls;metricattribute=count 2"); assertMetric(metrics, "graphitePrefix.counter.com.hotels.bdp.waggledance.server.FederatedHMSHandler.get_all_databases.all.success;metricattribute=count 2"); @@ -400,30 +400,16 @@ public void typicalWithGraphite() throws Exception { assertMetric(metrics, "graphitePrefix.counter.com.hotels.bdp.waggledance.server.FederatedHMSHandler.get_table_req.remote.calls;metricattribute=count 1"); assertMetric(metrics, - "graphitePrefix.counter.com.hotels.bdp.waggledance.server.FederatedHMSHandler.get_table_req.remote.success;metricattribute=count 1");*/ + "graphitePrefix.counter.com.hotels.bdp.waggledance.server.FederatedHMSHandler.get_table_req.remote.success;metricattribute=count 1"); assertMetric(metrics, "graphitePrefix.counter.com.hotels.bdp.waggledance.server.FederatedHMSHandler.success"); assertMetric(metrics, "graphitePrefix.counter.com.hotels.bdp.waggledance.server.FederatedHMSHandler.calls"); - /*assertMetric(metrics, - "graphitePrefix.counter.com.hotels.bdp.waggledance.server.FederatedHMSHandler.calls{federation_namespace='get_all_databases',method_name='all'}=count 1"); - assertMetric(metrics, - "graphitePrefix.counter.com.hotels.bdp.waggledance.server.FederatedHMSHandler.failure{federation_namespace='get_all_databases',method_name='all'}=count 1"); - assertMetric(metrics, - "graphitePrefix.counter.com.hotels.bdp.waggledance.server.FederatedHMSHandler.calls{federation_namespace='get_table_req',method_name='primary'}=count 1"); - assertMetric(metrics, - "graphitePrefix.counter.com.hotels.bdp.waggledance.server.FederatedHMSHandler.success{federation_namespace='get_table_req',method_name='primary'}=count 1"); - assertMetric(metrics, - "graphitePrefix.counter.com.hotels.bdp.waggledance.server.FederatedHMSHandler.failure{federation_namespace='get_table_req',method_name='primary'}=count 1"); -*/ } + } private void assertMetric(Set metrics, String partialMetric) { for (String metric : metrics) { if (metric.startsWith(partialMetric)) { - LOG.info("==================================================================="); - LOG.info(metric); - LOG.info(partialMetric); - LOG.info("==================================================================="); return; } }