Search in sources :

Example 1 with MetricsService

use of com.hazelcast.internal.metrics.impl.MetricsService in project hazelcast by hazelcast.

the class ReadMetricsOperation method doSendResponse.

private void doSendResponse(Object value) {
    try {
        sendResponse(value);
    } finally {
        final MetricsService service = getService();
        service.getLiveOperationRegistry().deregister(this);
    }
}
Also used : MetricsService(com.hazelcast.internal.metrics.impl.MetricsService)

Example 2 with MetricsService

use of com.hazelcast.internal.metrics.impl.MetricsService in project hazelcast by hazelcast.

the class JetServiceBackend method init.

// ManagedService
@Override
public void init(NodeEngine engine, Properties hzProperties) {
    this.nodeEngine = (NodeEngineImpl) engine;
    this.jet = new JetInstanceImpl(nodeEngine.getNode().hazelcastInstance, jetConfig);
    jobRepository = new JobRepository(engine.getHazelcastInstance());
    taskletExecutionService = new TaskletExecutionService(nodeEngine, jetConfig.getCooperativeThreadCount(), nodeEngine.getProperties());
    jobCoordinationService = createJobCoordinationService();
    jobClassLoaderService = new JobClassLoaderService(nodeEngine, jobRepository);
    jobExecutionService = new JobExecutionService(nodeEngine, taskletExecutionService, jobClassLoaderService);
    MetricsService metricsService = nodeEngine.getService(MetricsService.SERVICE_NAME);
    metricsService.registerPublisher(nodeEngine -> new JobMetricsPublisher(jobExecutionService, nodeEngine.getLocalMember()));
    nodeEngine.getMetricsRegistry().registerDynamicMetricsProvider(jobExecutionService);
    networking = new Networking(engine, jobExecutionService, jetConfig.getFlowControlPeriodMs());
    ClientEngine clientEngine = engine.getService(ClientEngineImpl.SERVICE_NAME);
    ClientExceptionFactory clientExceptionFactory = clientEngine.getExceptionFactory();
    if (clientExceptionFactory != null) {
        ExceptionUtil.registerJetExceptions(clientExceptionFactory);
    } else {
        logger.fine("Jet exceptions are not registered to the ClientExceptionFactory" + " since the ClientExceptionFactory is not accessible.");
    }
    logger.info("Setting number of cooperative threads and default parallelism to " + jetConfig.getCooperativeThreadCount());
}
Also used : JobMetricsPublisher(com.hazelcast.jet.impl.metrics.JobMetricsPublisher) ClientEngine(com.hazelcast.client.impl.ClientEngine) TaskletExecutionService(com.hazelcast.jet.impl.execution.TaskletExecutionService) MetricsService(com.hazelcast.internal.metrics.impl.MetricsService) ClientExceptionFactory(com.hazelcast.client.impl.protocol.ClientExceptionFactory)

Example 3 with MetricsService

use of com.hazelcast.internal.metrics.impl.MetricsService in project hazelcast by hazelcast.

the class ServiceManagerImpl method registerDefaultServices.

private void registerDefaultServices(ServicesConfig servicesConfig) {
    if (!servicesConfig.isEnableDefaults()) {
        return;
    }
    logger.finest("Registering default services...");
    registerService(MapService.SERVICE_NAME, createService(MapService.class));
    registerService(LockSupportService.SERVICE_NAME, new LockSupportServiceImpl(nodeEngine));
    registerService(QueueService.SERVICE_NAME, new QueueService(nodeEngine));
    registerService(TopicService.SERVICE_NAME, new TopicService());
    registerService(ReliableTopicService.SERVICE_NAME, new ReliableTopicService(nodeEngine));
    registerService(MultiMapService.SERVICE_NAME, new MultiMapService(nodeEngine));
    registerService(ListService.SERVICE_NAME, new ListService(nodeEngine));
    registerService(SetService.SERVICE_NAME, new SetService(nodeEngine));
    registerService(DistributedExecutorService.SERVICE_NAME, new DistributedExecutorService());
    registerService(DistributedDurableExecutorService.SERVICE_NAME, new DistributedDurableExecutorService(nodeEngine));
    registerService(FlakeIdGeneratorService.SERVICE_NAME, new FlakeIdGeneratorService(nodeEngine));
    registerService(ReplicatedMapService.SERVICE_NAME, new ReplicatedMapService(nodeEngine));
    registerService(RingbufferService.SERVICE_NAME, new RingbufferService(nodeEngine));
    registerService(XAService.SERVICE_NAME, new XAService(nodeEngine));
    registerService(CardinalityEstimatorService.SERVICE_NAME, new CardinalityEstimatorService());
    registerService(PNCounterService.SERVICE_NAME, new PNCounterService());
    registerService(CRDTReplicationMigrationService.SERVICE_NAME, new CRDTReplicationMigrationService());
    registerService(DistributedScheduledExecutorService.SERVICE_NAME, new DistributedScheduledExecutorService());
    registerService(MetricsService.SERVICE_NAME, new MetricsService(nodeEngine));
    registerCacheServiceIfAvailable();
    readServiceDescriptors();
}
Also used : DistributedDurableExecutorService(com.hazelcast.durableexecutor.impl.DistributedDurableExecutorService) XAService(com.hazelcast.transaction.impl.xa.XAService) CRDTReplicationMigrationService(com.hazelcast.internal.crdt.CRDTReplicationMigrationService) MetricsService(com.hazelcast.internal.metrics.impl.MetricsService) MultiMapService(com.hazelcast.multimap.impl.MultiMapService) SetService(com.hazelcast.collection.impl.set.SetService) ReplicatedMapService(com.hazelcast.replicatedmap.impl.ReplicatedMapService) QueueService(com.hazelcast.collection.impl.queue.QueueService) FlakeIdGeneratorService(com.hazelcast.flakeidgen.impl.FlakeIdGeneratorService) ListService(com.hazelcast.collection.impl.list.ListService) TopicService(com.hazelcast.topic.impl.TopicService) ReliableTopicService(com.hazelcast.topic.impl.reliable.ReliableTopicService) DistributedScheduledExecutorService(com.hazelcast.scheduledexecutor.impl.DistributedScheduledExecutorService) ReliableTopicService(com.hazelcast.topic.impl.reliable.ReliableTopicService) LockSupportServiceImpl(com.hazelcast.internal.locksupport.LockSupportServiceImpl) DistributedExecutorService(com.hazelcast.executor.impl.DistributedExecutorService) RingbufferService(com.hazelcast.ringbuffer.impl.RingbufferService) MultiMapService(com.hazelcast.multimap.impl.MultiMapService) ReplicatedMapService(com.hazelcast.replicatedmap.impl.ReplicatedMapService) MapService(com.hazelcast.map.impl.MapService) PNCounterService(com.hazelcast.internal.crdt.pncounter.PNCounterService) CardinalityEstimatorService(com.hazelcast.cardinality.impl.CardinalityEstimatorService)

Example 4 with MetricsService

use of com.hazelcast.internal.metrics.impl.MetricsService in project hazelcast by hazelcast.

the class ReadMetricsOperation method run.

@Override
public void run() {
    ILogger logger = getNodeEngine().getLogger(getClass());
    MetricsService service = getService();
    CompletableFuture<RingbufferSlice<Entry<Long, byte[]>>> future = service.readMetrics(offset);
    future.whenCompleteAsync(withTryCatch(logger, (slice, error) -> doSendResponse(error != null ? peel(error) : slice)), CALLER_RUNS);
}
Also used : CALLER_RUNS(com.hazelcast.internal.util.ConcurrencyUtil.CALLER_RUNS) IdentifiedDataSerializable(com.hazelcast.nio.serialization.IdentifiedDataSerializable) ExceptionUtil.peel(com.hazelcast.internal.util.ExceptionUtil.peel) IOException(java.io.IOException) CompletableFuture(java.util.concurrent.CompletableFuture) MetricsService(com.hazelcast.internal.metrics.impl.MetricsService) ILogger(com.hazelcast.logging.ILogger) Operation(com.hazelcast.spi.impl.operationservice.Operation) ReadonlyOperation(com.hazelcast.spi.impl.operationservice.ReadonlyOperation) Entry(java.util.Map.Entry) ExceptionUtil.withTryCatch(com.hazelcast.internal.util.ExceptionUtil.withTryCatch) RingbufferSlice(com.hazelcast.internal.metrics.managementcenter.ConcurrentArrayRingbuffer.RingbufferSlice) ObjectDataOutput(com.hazelcast.nio.ObjectDataOutput) ObjectDataInput(com.hazelcast.nio.ObjectDataInput) RingbufferSlice(com.hazelcast.internal.metrics.managementcenter.ConcurrentArrayRingbuffer.RingbufferSlice) MetricsService(com.hazelcast.internal.metrics.impl.MetricsService) ILogger(com.hazelcast.logging.ILogger)

Example 5 with MetricsService

use of com.hazelcast.internal.metrics.impl.MetricsService in project hazelcast by hazelcast.

the class ReadMetricsOperation method beforeRun.

@Override
public void beforeRun() {
    MetricsService service = getService();
    service.getLiveOperationRegistry().register(this);
}
Also used : MetricsService(com.hazelcast.internal.metrics.impl.MetricsService)

Aggregations

MetricsService (com.hazelcast.internal.metrics.impl.MetricsService)6 CardinalityEstimatorService (com.hazelcast.cardinality.impl.CardinalityEstimatorService)1 ClientEngine (com.hazelcast.client.impl.ClientEngine)1 ClientExceptionFactory (com.hazelcast.client.impl.protocol.ClientExceptionFactory)1 Address (com.hazelcast.cluster.Address)1 ListService (com.hazelcast.collection.impl.list.ListService)1 QueueService (com.hazelcast.collection.impl.queue.QueueService)1 SetService (com.hazelcast.collection.impl.set.SetService)1 Config (com.hazelcast.config.Config)1 NetworkConfig (com.hazelcast.config.NetworkConfig)1 XmlConfigBuilder (com.hazelcast.config.XmlConfigBuilder)1 YamlConfigBuilder (com.hazelcast.config.YamlConfigBuilder)1 Hazelcast (com.hazelcast.core.Hazelcast)1 HazelcastInstance (com.hazelcast.core.HazelcastInstance)1 DistributedDurableExecutorService (com.hazelcast.durableexecutor.impl.DistributedDurableExecutorService)1 DistributedExecutorService (com.hazelcast.executor.impl.DistributedExecutorService)1 FlakeIdGeneratorService (com.hazelcast.flakeidgen.impl.FlakeIdGeneratorService)1 FunctionEx (com.hazelcast.function.FunctionEx)1 DefaultNodeContext (com.hazelcast.instance.impl.DefaultNodeContext)1 HazelcastInstanceFactory (com.hazelcast.instance.impl.HazelcastInstanceFactory)1