Skip to content

Commit

Permalink
Add classloader weak cache
Browse files Browse the repository at this point in the history
  • Loading branch information
amarziali committed Jun 27, 2024
1 parent 7a9710e commit d8b68bc
Show file tree
Hide file tree
Showing 2 changed files with 189 additions and 137 deletions.
12 changes: 4 additions & 8 deletions src/main/java/org/datadog/jmxfetch/JmxComplexAttribute.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,9 @@ private void populateSubAttributeList(Object attributeValue) {
for (String key : data.keySet()) {
this.subAttributeList.add(key);
}
} else if (JeeStatisticsAttributes.CLASS_STATISTIC != null
&& JeeStatisticsAttributes.CLASS_STATISTIC.isInstance(attributeValue)) {
} else if (JeeStatisticsAttributes.isJeeStatistic(attributeValue)) {
this.subAttributeList.addAll(JeeStatisticsAttributes.attributesFor(attributeValue));
} else if (JeeStatisticsAttributes.CLASS_STATS != null
&& JeeStatisticsAttributes.CLASS_STATS.isInstance(attributeValue)) {
} else if (JeeStatisticsAttributes.isJeeStat(attributeValue)) {
this.subAttributeList.addAll(JeeStatisticsAttributes.getStatisticNames(attributeValue));
}
}
Expand Down Expand Up @@ -106,11 +104,9 @@ private Object getValue(String subAttribute)
} else if (value instanceof java.util.Map) {
Map<String, Object> data = (Map<String, Object>) value;
return data.get(subAttribute);
} else if (JeeStatisticsAttributes.CLASS_STATISTIC != null
&& JeeStatisticsAttributes.CLASS_STATISTIC.isInstance(value)) {
} else if (JeeStatisticsAttributes.isJeeStatistic(value)) {
return JeeStatisticsAttributes.dataFor(value, subAttribute);
} else if (JeeStatisticsAttributes.CLASS_STATS != null
&& JeeStatisticsAttributes.CLASS_STATS.isInstance(value)) {
} else if (JeeStatisticsAttributes.isJeeStat(value)) {
return JeeStatisticsAttributes.getStatisticDataFor(value, subAttribute);
}
throw new NumberFormatException();
Expand Down
Loading

0 comments on commit d8b68bc

Please sign in to comment.