use of com.hazelcast.internal.metrics.MetricsRegistry in project hazelcast by hazelcast.
the class MetricsPropertiesTest method verifyDataStructureMetricPresent.
private void verifyDataStructureMetricPresent(HazelcastInstance instance, boolean shouldContain) {
CapturingCollector collector = new CapturingCollector();
instance.getMap("testMap").put("42", "42");
MetricsRegistry metricsRegistry = getNodeEngineImpl(instance).getMetricsRegistry();
metricsRegistry.collect(collector);
MetricDescriptor descriptor = DEFAULT_DESCRIPTOR_SUPPLIER.get().withPrefix(MAP_PREFIX).withDiscriminator(MAP_DISCRIMINATOR_NAME, "testMap").withMetric("putCount").withUnit(COUNT);
if (shouldContain) {
assertContains(collector.captures().keySet(), descriptor);
} else {
assertNotContains(collector.captures().keySet(), descriptor);
}
}
use of com.hazelcast.internal.metrics.MetricsRegistry in project hazelcast by hazelcast.
the class MetricsPropertiesTest method testDebugMetricsSysPropDisabled.
@Test
public void testDebugMetricsSysPropDisabled() {
System.setProperty(ClusterProperty.METRICS_DEBUG.getName(), "false");
HazelcastInstance instance = createHazelcastInstance();
MetricsRegistry metricsRegistry = getNodeEngineImpl(instance).getMetricsRegistry();
assertEquals(INFO, metricsRegistry.minimumLevel());
}
use of com.hazelcast.internal.metrics.MetricsRegistry in project hazelcast by hazelcast.
the class AdvancedNetworkStatsIntegrationTest method assertAllNetworkStatsNotRegisteredAsMetrics.
private void assertAllNetworkStatsNotRegisteredAsMetrics(HazelcastInstance instance) {
MetricsRegistry registry = getNode(instance).nodeEngine.getMetricsRegistry();
for (ProtocolType protocolType : ProtocolType.values()) {
assertNotContains(registry.getNames(), "tcp.bytesReceived." + protocolType.name());
assertNotContains(registry.getNames(), "tcp.bytesSend." + protocolType.name());
}
}
use of com.hazelcast.internal.metrics.MetricsRegistry in project hazelcast-simulator by hazelcast.
the class NetworkTest method setup.
@Setup
public void setup() throws Exception {
Node node = HazelcastTestUtils.getNode(targetInstance);
if (node == null) {
throw new IllegalStateException("node is null");
}
MetricsRegistry metricsRegistry = node.nodeEngine.getMetricsRegistry();
LoggingService loggingService = node.loggingService;
HazelcastThreadGroup threadGroup = node.getHazelcastThreadGroup();
// we don't know the number of worker threads (damn hidden property), so lets assume 1000.. that should be enough
packetHandler = new RequestPacketHandler(1000);
Address thisAddress = node.getThisAddress();
Address newThisAddress = new Address(thisAddress.getHost(), thisAddress.getPort() + PORT_OFFSET);
logger.info("ThisAddress: " + newThisAddress);
MockIOService ioService = new MockIOService(newThisAddress, loggingService);
ioService.inputThreadCount = inputThreadCount;
ioService.outputThreadCount = outputThreadCount;
ioService.socketNoDelay = socketNoDelay;
ioService.packetHandler = packetHandler;
ioService.socketSendBufferSize = socketSendBufferSize;
ioService.socketReceiveBufferSize = socketReceiveBufferSize;
if (trackSequenceId) {
ioService.writeHandlerFactory = new TaggingWriteHandlerFactory();
}
IOThreadingModel threadingModel = null;
switch(ioThreadingModel) {
// break;
default:
throw new IllegalStateException("Unrecognized threading model: " + ioThreadingModel);
}
//
// connectionManager = new TcpIpConnectionManager(
// ioService, ioService.serverSocketChannel, loggingService, metricsRegistry, threadingModel);
// connectionManager.start();
// networkCreateLock = targetInstance.getLock("connectionCreateLock");
}
Aggregations