use of com.hazelcast.internal.metrics.ProbeLevel in project hazelcast by hazelcast.
the class HazelcastPropertiesTest method getEnum_ignoredName.
@Test
public void getEnum_ignoredName() {
config.setProperty(Diagnostics.METRICS_LEVEL.getName(), "dEbUg");
HazelcastProperties properties = new HazelcastProperties(config);
ProbeLevel level = properties.getEnum(Diagnostics.METRICS_LEVEL, ProbeLevel.class);
assertEquals(ProbeLevel.DEBUG, level);
}
use of com.hazelcast.internal.metrics.ProbeLevel in project hazelcast by hazelcast.
the class HazelcastClientInstanceImpl method initMetricsRegistry.
private MetricsRegistryImpl initMetricsRegistry() {
ProbeLevel probeLevel = properties.getEnum(Diagnostics.METRICS_LEVEL, ProbeLevel.class);
ILogger logger = loggingService.getLogger(MetricsRegistryImpl.class);
MetricsRegistryImpl metricsRegistry = new MetricsRegistryImpl(logger, probeLevel);
RuntimeMetricSet.register(metricsRegistry);
GarbageCollectionMetricSet.register(metricsRegistry);
OperatingSystemMetricSet.register(metricsRegistry);
ThreadMetricSet.register(metricsRegistry);
ClassLoadingMetricSet.register(metricsRegistry);
FileMetricSet.register(metricsRegistry);
return metricsRegistry;
}
use of com.hazelcast.internal.metrics.ProbeLevel in project hazelcast by hazelcast.
the class MetricsConfigHelper method memberMetricsLevel.
public static ProbeLevel memberMetricsLevel(HazelcastProperties properties, ILogger logger) {
boolean debugMetrics = properties.getBoolean(ClusterProperty.METRICS_DEBUG);
ProbeLevel probeLevel = debugMetrics ? DEBUG : INFO;
if (probeLevel == INFO) {
logger.fine("Collecting debug metrics and sending to diagnostics is disabled");
} else {
logger.info("Collecting debug metrics and sending to diagnostics is enabled");
}
return probeLevel;
}
use of com.hazelcast.internal.metrics.ProbeLevel in project hazelcast by hazelcast.
the class MetricsUtil method extractExcludedTargets.
private static Collection<MetricTarget> extractExcludedTargets(CachedProbe probe, SourceMetadata sourceMetadata) {
ProbeLevel level = probe.level();
Collection<MetricTarget> excludedTargetsClass = sourceMetadata.excludedTargetsClass();
Set<MetricTarget> excludedTargetsProbe = asSet(probe.excludedTargets());
Set<MetricTarget> excludedTargetsUnion = MetricTarget.union(excludedTargetsClass, excludedTargetsProbe);
if (DEBUG != level) {
return excludedTargetsUnion;
} else if (excludedTargetsUnion.contains(DIAGNOSTICS)) {
return ALL_TARGETS;
} else {
return ALL_TARGETS_BUT_DIAGNOSTICS;
}
}
use of com.hazelcast.internal.metrics.ProbeLevel in project hazelcast by hazelcast.
the class MetricsConfigHelper method clientMetricsLevel.
public static ProbeLevel clientMetricsLevel(HazelcastProperties properties, ILogger logger) {
boolean debugMetrics = properties.getBoolean(ClientProperty.METRICS_DEBUG);
ProbeLevel probeLevel = debugMetrics ? DEBUG : INFO;
if (probeLevel == INFO) {
logger.fine("Collecting debug metrics and sending to diagnostics is disabled");
} else {
logger.info("Collecting debug metrics and sending to diagnostics is enabled");
}
return probeLevel;
}
Aggregations