public class SimpleRecorder extends AbstractRecorder
AbstractRecorder.Collect, AbstractRecorder.Collector, AbstractRecorder.EveryPattern<T extends SpeedEvent>, AbstractRecorder.StatisticPattern<V>
限定符和类型 | 字段和说明 |
---|---|
private SpeedEvent |
event |
private List<Long> |
nums |
everyPattern, name, state, statisticPattern
限定符 | 构造器和说明 |
---|---|
private |
SimpleRecorder(String name) |
限定符和类型 | 方法和说明 |
---|---|
static SimpleRecorder |
build(Class clazz) |
static SimpleRecorder |
build(String name) |
protected void |
onEnd()
结束一次记录,在这里进行一次记录的输出,同时将耗时的值保存到列表用于统计
|
protected void |
onReset()
执行重置操作
|
protected void |
onStart()
开始一次记录,在这里应该创建一个SpeedEvent实体对象,传入开始时间
|
protected void |
onStatistics()
执行统计操作
|
protected void |
onStop()
停止记录器,在这里将对记录器中所有内容进行统计,统计完成后清空记录器内容
|
protected AbstractRecorder.EveryPattern |
setEveryPattern()
创建默认的记录接口实现
|
protected AbstractRecorder.StatisticPattern |
setStatisticPattern()
创建默认的统计接口实现
|
collect, end, getEveryPattern, getName, getStatisticPattern, reset, setEveryPattern, setStatisticPattern, start, statistics, stop
private SpeedEvent event
private SimpleRecorder(String name)
protected AbstractRecorder.EveryPattern setEveryPattern()
setEveryPattern
在类中 AbstractRecorder
protected AbstractRecorder.StatisticPattern setStatisticPattern()
setStatisticPattern
在类中 AbstractRecorder
protected void onStart()
onStart
在类中 AbstractRecorder
protected void onEnd()
onEnd
在类中 AbstractRecorder
protected void onReset()
onReset
在类中 AbstractRecorder
protected void onStop()
onStop
在类中 AbstractRecorder
protected void onStatistics()
onStatistics
在类中 AbstractRecorder
public static SimpleRecorder build(String name)
public static SimpleRecorder build(Class clazz)
Copyright © 2020. All rights reserved.