Class ThreadMonitorInOut
java.lang.Object
com.iohao.net.framework.core.flow.internal.ThreadMonitorInOut
- All Implemented Interfaces:
ActionMethodInOut
PluginInOut - ThreadMonitorInOut - Business Thread Monitoring Plugin
for example
BarSkeletonBuilder builder = ...;
// Business thread monitoring plugin, add the plugin to the business framework
var threadMonitorInOut = new ThreadMonitorInOut();
builder.addInOut(threadMonitorInOut);
Print preview
Business thread [RequestMessage-8-1] executed 1 business task in total, average time consumption 1 ms, 91 tasks remaining to be executed Business thread [RequestMessage-8-2] executed 1 business task in total, average time consumption 1 ms, 0 tasks remaining to be executed Business thread [RequestMessage-8-3] executed 1 business task in total, average time consumption 1 ms, 36 tasks remaining to be executed Business thread [RequestMessage-8-4] executed 1 business task in total, average time consumption 1 ms, 0 tasks remaining to be executed Business thread [RequestMessage-8-5] executed 1 business task in total, average time consumption 1 ms, 88 tasks remaining to be executed Business thread [RequestMessage-8-6] executed 1 business task in total, average time consumption 1 ms, 0 tasks remaining to be executed Business thread [RequestMessage-8-7] executed 7 business tasks in total, average time consumption 1 ms, 56 tasks remaining to be executed Business thread [RequestMessage-8-8] executed 1 business task in total, average time consumption 1 ms, 0 tasks remaining to be executed
- Author:
- 渔民小镇
- date:
- 2023-11-22
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordPer-thread monitoring record holding execution count, total time, and remaining queue size.static classRegion that managesThreadMonitorInOut.ThreadMonitorinstances, one per business thread. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidfuckIn(FlowContext flowContext) No-op before action method execution.voidfuckOut(FlowContext flowContext) Record thread execution statistics after action method execution.
-
Constructor Details
-
ThreadMonitorInOut
public ThreadMonitorInOut()
-
-
Method Details
-
fuckIn
No-op before action method execution.- Specified by:
fuckInin interfaceActionMethodInOut- Parameters:
flowContext- the current request flow context
-
fuckOut
Record thread execution statistics after action method execution.Captures the elapsed time and updates the
ThreadMonitorInOut.ThreadMonitorRegionwith the current thread executor's metrics.- Specified by:
fuckOutin interfaceActionMethodInOut- Parameters:
flowContext- the current request flow context
-
getRegion
-