public class IpPathAccessStats extends Object
Modifier and Type | Field and Description |
---|---|
Map<Long,CaffeineCache> |
cacheMap
key: 时长段,单位:秒
value: CaffeineCache: key: ip, value: IpAccessStat
|
List<Long> |
durationList
时长段列表
|
Constructor and Description |
---|
IpPathAccessStats(StatPathFilter statPathFilter,
TioConfig tioConfig,
IpPathAccessStatListener ipPathAccessStatListener,
Long[] durations) |
Modifier and Type | Method and Description |
---|---|
void |
addDuration(Long duration,
IpPathAccessStatListener ipPathAccessStatListener)
添加监控时段
|
void |
addDurations(Long[] durations,
IpPathAccessStatListener ipPathAccessStatListener)
添加监控时段
|
void |
clear(Long duration)
清空监控数据
|
IpAccessStat |
get(Long duration,
String ip)
获取IpAccessStat
|
IpAccessStat |
get(Long duration,
String ip,
boolean forceCreate)
获取IpAccessStat
|
String |
getCacheName(Long duration) |
IpPathAccessStatListener |
getListener(Long duration) |
StatPathFilter |
getStatPathFilter() |
ConcurrentMap<String,Serializable> |
map(Long duration)
key: ip
value: IpPathAccessStat
|
void |
removeMonitor(Long duration)
删除监控时间段
|
void |
setStatPathFilter(StatPathFilter statPathFilter) |
Long |
size(Long duration) |
Collection<Serializable> |
values(Long duration) |
public final Map<Long,CaffeineCache> cacheMap
public IpPathAccessStats(StatPathFilter statPathFilter, TioConfig tioConfig, IpPathAccessStatListener ipPathAccessStatListener, Long[] durations)
tioConfig
- ipPathAccessStatListener
- durations
- public void addDuration(Long duration, IpPathAccessStatListener ipPathAccessStatListener)
duration
- 单位:秒ipPathAccessStatListener
- 可以为nullpublic IpPathAccessStatListener getListener(Long duration)
duration
- public void addDurations(Long[] durations, IpPathAccessStatListener ipPathAccessStatListener)
durations
- 单位:秒ipPathAccessStatListener
- 可以为nullpublic void removeMonitor(Long duration)
duration
- public void clear(Long duration)
public IpAccessStat get(Long duration, String ip, boolean forceCreate)
duration
- ip
- forceCreate
- public IpAccessStat get(Long duration, String ip)
duration
- ip
- public ConcurrentMap<String,Serializable> map(Long duration)
duration
- public Collection<Serializable> values(Long duration)
public StatPathFilter getStatPathFilter()
public void setStatPathFilter(StatPathFilter statPathFilter)
Copyright © 2021. All rights reserved.