Class LongTermStatsBase
java.lang.Object
com.biglybt.core.stats.transfer.impl.LongTermStatsBase
- All Implemented Interfaces:
LongTermStatsWrapper.LongTermStatsWrapperHelper, LongTermStats
- Direct Known Subclasses:
LongTermStatsGenericImpl, LongTermStatsImpl
public abstract class LongTermStatsBase
extends Object
implements LongTermStatsWrapper.LongTermStatsWrapperHelper
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classprivate classNested classes/interfaces inherited from interface LongTermStats
LongTermStats.GenericStatsSource, LongTermStats.RecordAccepter -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanprivate LongTermStatsBase.DayCacheprotected static final longprivate static final SimpleDateFormatprotected booleanprivate final AsyncDispatcherprivate TimerEventPeriodicprotected static final longprotected final long[]private final CopyOnWriteList<Object[]> protected static final longprivate final Map<String, LongTermStatsBase.MonthCache> private static final intprivate longprotected static final intprotected static final intprotected static final intprivate longprivate intprivate intprivate final Average[]protected final intprotected Fileprivate static final SimpleDateFormatprotected static final intprotected static final longprivate PrintWriterprivate StringFields inherited from interface LongTermStats
PT_CURRENT_DAY, PT_CURRENT_HOUR, PT_CURRENT_MONTH, PT_CURRENT_WEEK, PT_NAMES, PT_SLIDING_DAY, PT_SLIDING_HOUR, PT_SLIDING_WEEK, ST_DATA_DOWNLOAD, ST_DATA_UPLOAD, ST_DHT_DOWNLOAD, ST_DHT_UPLOAD, ST_PROTOCOL_DOWNLOAD, ST_PROTOCOL_UPLOAD -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(long min_delta_bytes, LongTermStatsListener listener) voidlong[]private LongTermStatsBase.MonthCachegetMonthCache(String year, String month) protected abstract long[]getNewFileSessionStats(long[] line_stats) longprivate static StringgetString(long[] stats) long[]getTotalUsageInPeriod(int period_type, double multiplier) long[]getTotalUsageInPeriod(int period_type, double multiplier, LongTermStats.RecordAccepter accepter) long[]getTotalUsageInPeriod(Date start_date, Date end_date) long[]getTotalUsageInPeriod(Date start_date, Date end_date, LongTermStats.RecordAccepter accepter) booleanvoidremoveListener(LongTermStatsListener listener) voidreset()protected voidprotected abstract voidprotected voidsessionStartComplete(String name) protected voidprotected abstract voidupdateStats(int record_type) protected voidwrite(int record_type, long[] line_stats)
-
Field Details
-
VERSION
protected static final int VERSION- See Also:
-
MIN_IN_MILLIS
protected static final long MIN_IN_MILLIS- See Also:
-
HOUR_IN_MILLIS
protected static final long HOUR_IN_MILLIS- See Also:
-
DAY_IN_MILLIS
protected static final long DAY_IN_MILLIS- See Also:
-
WEEK_IN_MILLIS
protected static final long WEEK_IN_MILLIS- See Also:
-
RT_SESSION_START
protected static final int RT_SESSION_START- See Also:
-
RT_SESSION_STATS
protected static final int RT_SESSION_STATS- See Also:
-
RT_SESSION_END
protected static final int RT_SESSION_END- See Also:
-
STAT_ENTRY_COUNT
protected final int STAT_ENTRY_COUNT -
line_stats_prev
protected final long[] line_stats_prev -
stat_averages
-
active
protected boolean active -
closing
protected boolean closing -
destroyed
protected volatile boolean destroyed -
overall_start_time
private volatile long overall_start_time -
event
-
writer
-
writer_rel_file
-
debug_utc_format
-
utc_date_format
-
stats_dir
-
session_total
private long session_total -
listeners
-
dispatcher
-
start_of_week
private int start_of_week -
start_of_month
private int start_of_month -
day_cache
-
MONTH_CACHE_MAX
private static final int MONTH_CACHE_MAX- See Also:
-
month_cache_map
-
-
Constructor Details
-
LongTermStatsBase
protected LongTermStatsBase(int entry_count)
-
-
Method Details
-
sessionStart
protected abstract void sessionStart() -
sessionStartComplete
-
sessionEnd
protected void sessionEnd() -
updateStats
protected void updateStats() -
updateStats
protected abstract void updateStats(int record_type) -
getNewFileSessionStats
protected abstract long[] getNewFileSessionStats(long[] line_stats) -
write
protected void write(int record_type, long[] line_stats) -
isEnabled
public boolean isEnabled()- Specified by:
isEnabledin interfaceLongTermStats
-
reset
public void reset()- Specified by:
resetin interfaceLongTermStats
-
destroyAndDeleteData
public void destroyAndDeleteData()- Specified by:
destroyAndDeleteDatain interfaceLongTermStatsWrapper.LongTermStatsWrapperHelper
-
getOverallStartTime
public long getOverallStartTime()- Specified by:
getOverallStartTimein interfaceLongTermStats
-
getTotalUsageInPeriod
- Specified by:
getTotalUsageInPeriodin interfaceLongTermStats
-
getTotalUsageInPeriod
public long[] getTotalUsageInPeriod(Date start_date, Date end_date, LongTermStats.RecordAccepter accepter) - Specified by:
getTotalUsageInPeriodin interfaceLongTermStats
-
getTotalUsageInPeriod
public long[] getTotalUsageInPeriod(int period_type, double multiplier) - Specified by:
getTotalUsageInPeriodin interfaceLongTermStats
-
getTotalUsageInPeriod
public long[] getTotalUsageInPeriod(int period_type, double multiplier, LongTermStats.RecordAccepter accepter) - Specified by:
getTotalUsageInPeriodin interfaceLongTermStats
-
getCurrentRateBytesPerSecond
public long[] getCurrentRateBytesPerSecond()- Specified by:
getCurrentRateBytesPerSecondin interfaceLongTermStats
-
getString
-
getMonthCache
-
addListener
- Specified by:
addListenerin interfaceLongTermStats
-
removeListener
- Specified by:
removeListenerin interfaceLongTermStats
-