Search in sources :

Example 1 with ProbeLevel

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);
}
Also used : ProbeLevel(com.hazelcast.internal.metrics.ProbeLevel) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 2 with ProbeLevel

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;
}
Also used : MetricsRegistryImpl(com.hazelcast.internal.metrics.impl.MetricsRegistryImpl) ILogger(com.hazelcast.logging.ILogger) ProbeLevel(com.hazelcast.internal.metrics.ProbeLevel)

Example 3 with ProbeLevel

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;
}
Also used : ProbeLevel(com.hazelcast.internal.metrics.ProbeLevel)

Example 4 with 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;
    }
}
Also used : MetricTarget(com.hazelcast.internal.metrics.MetricTarget) ProbeLevel(com.hazelcast.internal.metrics.ProbeLevel)

Example 5 with ProbeLevel

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;
}
Also used : ProbeLevel(com.hazelcast.internal.metrics.ProbeLevel)

Aggregations

ProbeLevel (com.hazelcast.internal.metrics.ProbeLevel)5 MetricTarget (com.hazelcast.internal.metrics.MetricTarget)1 MetricsRegistryImpl (com.hazelcast.internal.metrics.impl.MetricsRegistryImpl)1 ILogger (com.hazelcast.logging.ILogger)1 QuickTest (com.hazelcast.test.annotation.QuickTest)1 Test (org.junit.Test)1