Search in sources :

Example 1 with MicroProfileVendorMetricRegistry

use of org.wildfly.extension.microprofile.metrics.MicroProfileVendorMetricRegistry in project wildfly by wildfly.

the class DeploymentMetricService method start.

@Override
public void start(StartContext startContext) {
    final Runnable task = new Runnable() {

        @Override
        public void run() {
            try {
                registration = new MetricRegistration(new MicroProfileVendorMetricRegistry());
                metricCollector.get().collectResourceMetrics(rootResource, managementResourceRegistration, // prepend the deployment address to the subsystem resource address
                address -> deploymentAddress.append(address), exposeAnySubsystem, exposedSubsystems, prefix, registration);
            } catch (Throwable t) {
                t.printStackTrace();
                throw t;
            }
            startContext.complete();
        }
    };
    try {
        managementExecutor.get().execute(task);
    } catch (RejectedExecutionException e) {
        task.run();
    } finally {
        startContext.asynchronous();
    }
}
Also used : MicroProfileVendorMetricRegistry(org.wildfly.extension.microprofile.metrics.MicroProfileVendorMetricRegistry) MetricRegistration(org.wildfly.extension.metrics.MetricRegistration) RejectedExecutionException(java.util.concurrent.RejectedExecutionException)

Aggregations

RejectedExecutionException (java.util.concurrent.RejectedExecutionException)1 MetricRegistration (org.wildfly.extension.metrics.MetricRegistration)1 MicroProfileVendorMetricRegistry (org.wildfly.extension.microprofile.metrics.MicroProfileVendorMetricRegistry)1