|
@@ -158,7 +158,7 @@ class MetricsSourceAdapter implements DynamicMBean {
|
|
|
|
|
|
private void updateJmxCache() {
|
|
|
boolean getAllMetrics = false;
|
|
|
- synchronized (this) {
|
|
|
+ synchronized(this) {
|
|
|
if (Time.now() - jmxCacheTS >= jmxCacheTTL) {
|
|
|
// temporarilly advance the expiry while updating the cache
|
|
|
jmxCacheTS = Time.now() + jmxCacheTTL;
|
|
@@ -169,21 +169,24 @@ class MetricsSourceAdapter implements DynamicMBean {
|
|
|
getAllMetrics = true;
|
|
|
lastRecsCleared = false;
|
|
|
}
|
|
|
- } else {
|
|
|
+ }
|
|
|
+ else {
|
|
|
return;
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- if (getAllMetrics) {
|
|
|
- MetricsCollectorImpl builder = new MetricsCollectorImpl();
|
|
|
- getMetrics(builder, true);
|
|
|
- }
|
|
|
+ if (getAllMetrics) {
|
|
|
+ MetricsCollectorImpl builder = new MetricsCollectorImpl();
|
|
|
+ getMetrics(builder, true);
|
|
|
+ }
|
|
|
|
|
|
+ synchronized(this) {
|
|
|
updateAttrCache();
|
|
|
if (getAllMetrics) {
|
|
|
updateInfoCache();
|
|
|
}
|
|
|
jmxCacheTS = Time.now();
|
|
|
- lastRecs = null; // in case regular interval update is not running
|
|
|
+ lastRecs = null; // in case regular interval update is not running
|
|
|
lastRecsCleared = true;
|
|
|
}
|
|
|
}
|