|
@@ -61,7 +61,7 @@ class MetricsSourceAdapter implements DynamicMBean {
|
|
|
|
|
|
private Iterable<MetricsRecordImpl> lastRecs;
|
|
|
private long jmxCacheTS = 0;
|
|
|
- private int jmxCacheTTL;
|
|
|
+ private long jmxCacheTTL;
|
|
|
private MBeanInfo infoCache;
|
|
|
private ObjectName mbeanName;
|
|
|
private final boolean startMBeans;
|
|
@@ -69,7 +69,7 @@ class MetricsSourceAdapter implements DynamicMBean {
|
|
|
MetricsSourceAdapter(String prefix, String name, String description,
|
|
|
MetricsSource source, Iterable<MetricsTag> injectedTags,
|
|
|
MetricsFilter recordFilter, MetricsFilter metricFilter,
|
|
|
- int jmxCacheTTL, boolean startMBeans) {
|
|
|
+ long jmxCacheTTL, boolean startMBeans) {
|
|
|
this.prefix = checkNotNull(prefix, "prefix");
|
|
|
this.name = checkNotNull(name, "name");
|
|
|
this.source = checkNotNull(source, "source");
|
|
@@ -84,7 +84,7 @@ class MetricsSourceAdapter implements DynamicMBean {
|
|
|
|
|
|
MetricsSourceAdapter(String prefix, String name, String description,
|
|
|
MetricsSource source, Iterable<MetricsTag> injectedTags,
|
|
|
- int period, MetricsConfig conf) {
|
|
|
+ long period, MetricsConfig conf) {
|
|
|
this(prefix, name, description, source, injectedTags,
|
|
|
conf.getFilter(RECORD_FILTER_KEY),
|
|
|
conf.getFilter(METRIC_FILTER_KEY),
|
|
@@ -233,7 +233,11 @@ class MetricsSourceAdapter implements DynamicMBean {
|
|
|
return mbeanName;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ @VisibleForTesting
|
|
|
+ long getJmxCacheTTL() {
|
|
|
+ return jmxCacheTTL;
|
|
|
+ }
|
|
|
+
|
|
|
private void updateInfoCache() {
|
|
|
LOG.debug("Updating info cache...");
|
|
|
infoCache = infoBuilder.reset(lastRecs).get();
|