接口 StatActionInOut.StatActionChangeListener
- 封闭类:
StatActionInOut
public static interface StatActionInOut.StatActionChangeListener
action 调用统计插件 - StatAction 更新监听
-
方法概要
修饰符和类型方法说明void
changed
(StatActionInOut.StatAction statAction, long time, FlowContext flowContext) StatAction 统计记录更新后调用default List
<StatActionInOut.TimeRange> 创建时间范围;如果想将统计分得更细,只需要创建更多的时间范围。default void
flow
(StatActionInOut.StatAction statAction, long time, FlowContext flowContext) StatAction 更新监听流程default boolean
triggerUpdateTimeRange
(StatActionInOut.StatAction statAction, long time, FlowContext flowContext) 触发条件,触发 updateTimeRange 方法的前置条件default void
updateTimeRange
(StatActionInOut.StatAction statAction, long time, FlowContext flowContext) StatAction 统计记录更新中调用,当 trigger 方法为 true 时会调用
-
方法详细资料
-
changed
StatAction 统计记录更新后调用- 参数:
statAction
- action 统计记录time
- action 执行耗时flowContext
- flowContext
-
createTimeRangeList
创建时间范围;如果想将统计分得更细,只需要创建更多的时间范围。参考示例
List.of( TimeRange.create(500, 1000), TimeRange.create(1000, 1500), TimeRange.create(1500, 2000), TimeRange.create(2000, Long.MAX_VALUE, "> 2000"))
- 返回:
- 时间范围,List 必须非空
-
triggerUpdateTimeRange
default boolean triggerUpdateTimeRange(StatActionInOut.StatAction statAction, long time, FlowContext flowContext) 触发条件,触发 updateTimeRange 方法的前置条件开发者可以通常此方法来决定是否触发 updateTimeRange 方法。 比如可以在该方法内判断,只对某个或某些玩家来做监控。
- 参数:
statAction
- action 统计记录time
- action 执行耗时flowContext
- flowContext- 返回:
- true 表示满足条件;当为 true 时,会调用 updateTimeRange 方法
-
updateTimeRange
default void updateTimeRange(StatActionInOut.StatAction statAction, long time, FlowContext flowContext) StatAction 统计记录更新中调用,当 trigger 方法为 true 时会调用- 参数:
statAction
- action 统计记录time
- action 执行耗时flowContext
- flowContext
-
flow
StatAction 更新监听流程默认实现的流程为 1 先判断 triggerUpdateTimeRange 是否满足条件 2 当 triggerUpdateTimeRange 为 true 时,会执行 updateTimeRange 3 无论如何 changed 总是会被执行的
- 参数:
statAction
- action 统计记录time
- action 执行耗时flowContext
- flowContext
-