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