} catch (final MalformedObjectNameException e) {
throw new OperationFailedException(new ModelNode().set(e.getMessage()));
}
final EndpointRegistry registry = (EndpointRegistry) controller.getValue();
final Endpoint endpoint = registry.getEndpoint(endpointObjectName);
final ModelNode result = new ModelNode();
if (endpoint != null && endpoint.getEndpointMetrics() != null) {
final EndpointMetrics endpointMetrics = endpoint.getEndpointMetrics();
if (MIN_PROCESSING_TIME.equals(metricName)) {
result.set(String.valueOf(endpointMetrics.getMinProcessingTime()));
} else if (MAX_PROCESSING_TIME.equals(metricName)) {
result.set(String.valueOf(endpointMetrics.getMaxProcessingTime()));
} else if (AVERAGE_PROCESSING_TIME.equals(metricName)) {