public class Kid extends Object
| Modifier and Type | Method and Description |
|---|---|
List<GroupedStatistics> |
getAllGroupedStatistics()
获得所有已完成时段内各个tag的统计信息,新的在前,旧的在后
|
GroupedStatistics |
getLatestGroupedStatistics()
获得最近已完成时段内各个tag的统计信息
|
static Kid |
newKid()
使用默认值构造kid对象
|
static Kid |
newKid(int queueSize,
int timeSlice,
int drainToSize,
int ringBufferSize)
构造kid对象
|
boolean |
record(String tag,
long cost)
记录消耗时间
|
Kid |
setPoints(int first,
int... args)
设置全局需要统计的时间段,如果没有设置特定tag的时间段,则使用全局设置
|
Kid |
setPoints(String tag,
int first,
int... args)
设置特定tag需要统计的时间段
|
Snapshot |
snapshot()
获得kid工作快照
|
Kid |
start()
启动kid
|
boolean |
stop()
停止kid
|
public static Kid newKid(int queueSize, int timeSlice, int drainToSize, int ringBufferSize)
queueSize - 异步队列容量timeSlice - 统计时间间隔,单位为秒drainToSize - 每次从异步队列取出数据的数量ringBufferSize - 环形队列的大小public static Kid newKid()
public Kid setPoints(int first, int... args)
first - 如果只设置first,则kid会对时间范围在(0,first]和(first,Integer.MAX_VALUE]的数据进行统计args - 如果还设置了arg1,arg2,那么统计范围就变为(0,first],(first,arg1],(arg1,arg2],
(arg2,Integer.MAX_VALUE]public Kid setPoints(String tag, int first, int... args)
tag - tag名称first - 如果只设置first,则kid会对时间范围在(0,first]和(first,Integer.MAX_VALUE]的数据进行统计args - 如果还设置了arg1,arg2,那么统计范围就变为(0,first],(first,arg1],(arg1,arg2],
(arg2,Integer.MAX_VALUE]public Kid start()
public boolean stop()
public boolean record(String tag, long cost)
tag - tag名称cost - 消耗时间public GroupedStatistics getLatestGroupedStatistics()
public List<GroupedStatistics> getAllGroupedStatistics()
public Snapshot snapshot()
Copyright © 2013. All rights reserved.