use of io.cdap.cdap.internal.profile.ProfileMetricService in project cdap by caskdata.
the class DefaultRuntimeJob method createCoreServices.
@VisibleForTesting
Deque<Service> createCoreServices(Injector injector, Arguments systemArgs, Cluster cluster) {
Deque<Service> services = new LinkedList<>();
services.add(injector.getInstance(LogAppenderLoaderService.class));
MessagingService messagingService = injector.getInstance(MessagingService.class);
if (messagingService instanceof Service) {
services.add((Service) messagingService);
}
services.add(injector.getInstance(MessagingHttpService.class));
// Metrics need TMS, hence start it after TMS.
MetricsCollectionService metricsCollectionService = injector.getInstance(MetricsCollectionService.class);
services.add(metricsCollectionService);
// Starts the traffic relay if monitoring is done through SSH tunnel
if (injector.getInstance(RuntimeMonitorType.class) == RuntimeMonitorType.SSH) {
services.add(injector.getInstance(TrafficRelayService.class));
}
runtimeClientService = injector.getInstance(RuntimeClientService.class);
services.add(runtimeClientService);
// Creates a service to emit profile metrics
ProgramRunId programRunId = injector.getInstance(ProgramRunId.class);
ProfileId profileId = SystemArguments.getProfileIdFromArgs(programRunId.getNamespaceId(), systemArgs.asMap()).orElseThrow(() -> new IllegalStateException("Missing profile information for program run " + programRunId));
services.add(new ProfileMetricService(metricsCollectionService, programRunId, profileId, cluster.getNodes().size()));
return services;
}
use of io.cdap.cdap.internal.profile.ProfileMetricService in project cdap by cdapio.
the class DefaultRuntimeJob method createCoreServices.
@VisibleForTesting
Deque<Service> createCoreServices(Injector injector, Arguments systemArgs, Cluster cluster) {
Deque<Service> services = new LinkedList<>();
services.add(injector.getInstance(LogAppenderLoaderService.class));
MessagingService messagingService = injector.getInstance(MessagingService.class);
if (messagingService instanceof Service) {
services.add((Service) messagingService);
}
services.add(injector.getInstance(MessagingHttpService.class));
// Metrics need TMS, hence start it after TMS.
MetricsCollectionService metricsCollectionService = injector.getInstance(MetricsCollectionService.class);
services.add(metricsCollectionService);
// Starts the traffic relay if monitoring is done through SSH tunnel
if (injector.getInstance(RuntimeMonitorType.class) == RuntimeMonitorType.SSH) {
services.add(injector.getInstance(TrafficRelayService.class));
}
runtimeClientService = injector.getInstance(RuntimeClientService.class);
services.add(runtimeClientService);
// Creates a service to emit profile metrics
ProgramRunId programRunId = injector.getInstance(ProgramRunId.class);
ProfileId profileId = SystemArguments.getProfileIdFromArgs(programRunId.getNamespaceId(), systemArgs.asMap()).orElseThrow(() -> new IllegalStateException("Missing profile information for program run " + programRunId));
services.add(new ProfileMetricService(metricsCollectionService, programRunId, profileId, cluster.getNodes().size()));
return services;
}
Aggregations