Class TimeRangeInOut
java.lang.Object
com.iohao.net.framework.core.flow.internal.TimeRangeInOut
- All Implemented Interfaces:
ActionMethodInOut
PluginInOut - TimeRangeInOut - Call Statistics Plugin for Each Time Period
BarSkeletonBuilder builder = ...;
// Add the plugin to the business framework
var timeRangeInOut = new TimeRangeInOut();
builder.addInOut(timeRangeInOut);
Print Preview - Call statistics data for each hour and minute segment of the day
2023-11-29 Total action calls: [100] times
0:00 共 8 次; - [15~30 min 3 次] - [30~45 min 2 次] - [45~59 min 3 次]
1:00 共 9 次; - [0~15 min 1 次] - [15~30 min 4 次] - [30~45 min 1 次] - [45~59 min 3 次]
2:00 共 4 次; - [0~15 min 1 次] - [15~30 min 2 次] - [45~59 min 1 次]
3:00 共 2 次; - [0~15 min 1 次] - [15~30 min 1 次]
4:00 共 1 次; - [0~15 min 1 次]
5:00 共 4 次; - [0~15 min 1 次] - [15~30 min 1 次] - [30~45 min 1 次] - [45~59 min 1 次]
6:00 共 5 次; - [0~15 min 1 次] - [15~30 min 1 次] - [30~45 min 1 次] - [45~59 min 2 次]
7:00 共 4 次; - [15~30 min 2 次] - [30~45 min 1 次] - [45~59 min 1 次]
8:00 共 4 次; - [0~15 min 1 次] - [30~45 min 3 次]
9:00 共 4 次; - [15~30 min 2 次] - [30~45 min 2 次]
10:00 共 5 次; - [15~30 min 2 次] - [30~45 min 1 次] - [45~59 min 2 次]
11:00 共 3 次; - [15~30 min 2 次] - [45~59 min 1 次]
12:00 共 4 次; - [0~15 min 2 次] - [30~45 min 2 次]
13:00 共 1 次; - [30~45 min 1 次]
14:00 共 5 次; - [0~15 min 1 次] - [45~59 min 4 次]
15:00 共 6 次; - [0~15 min 1 次] - [15~30 min 2 次] - [45~59 min 3 次]
16:00 共 4 次; - [0~15 min 1 次] - [15~30 min 1 次] - [30~45 min 1 次] - [45~59 min 1 次]
17:00 共 7 次; - [0~15 min 1 次] - [15~30 min 3 次] - [30~45 min 3 次]
18:00 共 2 次; - [0~15 min 1 次] - [15~30 min 1 次]
19:00 共 7 次; - [0~15 min 1 次] - [15~30 min 3 次] - [30~45 min 3 次]
20:00 共 5 次; - [15~30 min 3 次] - [30~45 min 2 次]
21:00 共 3 次; - [15~30 min 2 次] - [30~45 min 1 次]
22:00 共 1 次; - [45~59 min 1 次]
23:00 共 2 次; - [15~30 min 1 次] - [45~59 min 1 次]
set Listener example
private void setListener(TimeRangeInOut inOut) {
inOut.setListener(new TimeRangeInOut.ChangeListener() {
@Override
public List<TimeRangeInOut.TimeRangeMinute> createListenerTimeRangeMinuteList() {
return List.of(
// Only statistically count these 3 time points: 0, 1, and 59 minutes
TimeRangeInOut.TimeRangeMinute.create(0, 0),
TimeRangeInOut.TimeRangeMinute.create(1, 1),
TimeRangeInOut.TimeRangeMinute.create(59, 59)
);
}
});
}
- Author:
- 渔民小镇
- See Also:
- date:
- 2023-11-29
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceListener interface forTimeRangeInOutchange notifications and customization.static final recordDaily call statistics record holding the date, total count, and per-hour breakdowns.final classRegion that managesTimeRangeInOut.TimeRangeDayinstances, one per calendar date.static final recordHourly call statistics record holding the hour, total count, and per-minute breakdowns.static final recordMinute-range statistics record within an hour. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidfuckIn(FlowContext flowContext) No-op before action method execution.voidfuckOut(FlowContext flowContext) Record the current time-of-day statistics after action method execution.voidsetListener(TimeRangeInOut.ChangeListener listener) Set Listener
-
Constructor Details
-
TimeRangeInOut
public TimeRangeInOut()
-
-
Method Details
-
setListener
Set Listener- Parameters:
listener- listener
-
fuckIn
No-op before action method execution.- Specified by:
fuckInin interfaceActionMethodInOut- Parameters:
flowContext- the current request flow context
-
fuckOut
Record the current time-of-day statistics after action method execution.- Specified by:
fuckOutin interfaceActionMethodInOut- Parameters:
flowContext- the current request flow context
-
getRegion
-
getListener
-