Search in sources :

Example 1 with MetricRegistry

use of org.wildfly.extension.metrics.MetricRegistry in project wildfly by wildfly.

the class DeploymentMetricService method install.

public static void install(ServiceTarget serviceTarget, DeploymentUnit deploymentUnit, Resource rootResource, ManagementResourceRegistration managementResourceRegistration, boolean exposeAnySubsystem, List<String> exposedSubsystems, String prefix) {
    PathAddress deploymentAddress = createDeploymentAddressPrefix(deploymentUnit);
    ServiceBuilder<?> sb = serviceTarget.addService(deploymentUnit.getServiceName().append("metrics"));
    Supplier<MetricCollector> metricCollector = sb.requires(WILDFLY_COLLECTOR);
    Supplier<MetricRegistry> metricRegistry = sb.requires(METRICS_REGISTRY_RUNTIME_CAPABILITY.getCapabilityServiceName());
    Supplier<Executor> managementExecutor = sb.requires(ServerService.EXECUTOR_CAPABILITY.getCapabilityServiceName());
    /*
         * The deployment metric service depends on the deployment complete service name to ensure that the metrics from
         * the deployment are collected and registered once the deployment services have all been properly installed.
         */
    sb.requires(DeploymentCompleteServiceProcessor.serviceName(deploymentUnit.getServiceName()));
    sb.setInstance(new DeploymentMetricService(rootResource, managementResourceRegistration, deploymentAddress, metricCollector, metricRegistry, managementExecutor, exposeAnySubsystem, exposedSubsystems, prefix)).install();
}
Also used : Executor(java.util.concurrent.Executor) PathAddress(org.jboss.as.controller.PathAddress) MetricRegistry(org.wildfly.extension.metrics.MetricRegistry) MetricCollector(org.wildfly.extension.metrics.MetricCollector)

Aggregations

Executor (java.util.concurrent.Executor)1 PathAddress (org.jboss.as.controller.PathAddress)1 MetricCollector (org.wildfly.extension.metrics.MetricCollector)1 MetricRegistry (org.wildfly.extension.metrics.MetricRegistry)1