You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2019/06/28 12:47:29 UTC

[GitHub] [hbase] petersomogyi commented on a change in pull request #346: HBASE-22637 fix flaky test in TestMetaTableMetrics

petersomogyi commented on a change in pull request #346: HBASE-22637 fix flaky test in TestMetaTableMetrics
URL: https://github.com/apache/hbase/pull/346#discussion_r298576844
 
 

 ##########
 File path: hbase-server/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMetaTableMetrics.java
 ##########
 @@ -162,18 +228,22 @@ private void writeData(Table t) throws IOException {
       pairs.put("service", "HBase");
       pairs.put("name", "RegionServer");
       pairs.put("sub",
-        "Coprocessor.Region.CP_org.apache.hadoop.hbase.coprocessor"
-            + ".MetaTableMetrics");
+        "Coprocessor.Region.CP_org.apache.hadoop.hbase.coprocessor.MetaTableMetrics");
       target = new ObjectName("Hadoop", pairs);
       MBeanInfo beanInfo = mb.getMBeanInfo(target);
 
-      Set<String> existingAttrs = new HashSet<>();
+      Map<String, Double> existingAttrs = new HashMap<>();
       for (MBeanAttributeInfo attrInfo : beanInfo.getAttributes()) {
-        existingAttrs.add(attrInfo.getName());
+        Object value = mb.getAttribute(target, attrInfo.getName());
+        if (attrInfo.getName().startsWith(METRICS_ATTRIBUTE_NAME_PREFIX)
+            && value instanceof Number) {
+          existingAttrs.put(attrInfo.getName(), Double.parseDouble(value.toString()));
+        }
       }
+      LOG.warn("MBean Found: " + target);
 
 Review comment:
   Should this be info level?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services