diff --git a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/startup/RuntimeResourceDeployment.java b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/startup/RuntimeResourceDeployment.java index f3ef562e331b5..8040becfe515b 100644 --- a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/startup/RuntimeResourceDeployment.java +++ b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/startup/RuntimeResourceDeployment.java @@ -218,21 +218,23 @@ public RuntimeResource buildResourceMethod(ResourceClass clazz, if (method.isBlocking()) { if (method.isRunOnVirtualThread()) { handlers.add(blockingHandlerVirtualThread); + score.add(ScoreSystem.Category.Execution, ScoreSystem.Diagnostic.ExecutionVirtualThread); } else { handlers.add(blockingHandler); + score.add(ScoreSystem.Category.Execution, ScoreSystem.Diagnostic.ExecutionBlocking); } blockingHandlerIndex = Optional.of(handlers.size() - 1); - score.add(ScoreSystem.Category.Execution, ScoreSystem.Diagnostic.ExecutionBlocking); } else { if (method.isRunOnVirtualThread()) { //should not happen - log.error("a method was both non blocking and @RunOnVirtualThread, it is now considered " + + log.error("a method was both non-blocking and @RunOnVirtualThread, it is now considered " + "@RunOnVirtual and blocking"); handlers.add(blockingHandlerVirtualThread); + score.add(ScoreSystem.Category.Execution, ScoreSystem.Diagnostic.ExecutionVirtualThread); } else { handlers.add(NonBlockingHandler.INSTANCE); + score.add(ScoreSystem.Category.Execution, ScoreSystem.Diagnostic.ExecutionNonBlocking); } - score.add(ScoreSystem.Category.Execution, ScoreSystem.Diagnostic.ExecutionNonBlocking); } } diff --git a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/util/ScoreSystem.java b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/util/ScoreSystem.java index 38ca3ee4f3a36..11520d74fa92d 100644 --- a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/util/ScoreSystem.java +++ b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/util/ScoreSystem.java @@ -89,6 +89,8 @@ public String toString() { public static Diagnostic ExecutionNonBlocking = new Diagnostic("Dispatched on the IO thread", 100); public static Diagnostic ExecutionBlocking = new Diagnostic("Relies on a blocking worker thread", 0); + public static Diagnostic ExecutionVirtualThread = new Diagnostic("Relies on a virtual thread", 66); + public static Diagnostic ResourceSingleton = new Diagnostic("Single resource instance for all requests", 100); public static Diagnostic ResourcePerRequest = new Diagnostic("New resource instance for every request", 0);