Package io.higson.runtime.profiler
Class ProfilerBucket<T,S extends AbstractProfilerStat<T>>
java.lang.Object
io.higson.runtime.profiler.ProfilerBucket<T,S>
- Type Parameters:
T- key typeS- statistics object type
Lock-guarded bucket of statistics to be used by AbstractProfiler.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds [time] measured for given [key].voidclear()Removes all statistics from internal storage.Gets statistics copy for given [key], or null if there is no statisticsReturns collection of all statistics held by this bucket.
-
Constructor Details
-
ProfilerBucket
public ProfilerBucket()
-
-
Method Details
-
addTime
Adds [time] measured for given [key]. Updating statistics is guarded by [lock] dedicated for this bucket only. If there is no statistics object for [key] it will be created using provided [keyStatSupplier] -
getStat
Gets statistics copy for given [key], or null if there is no statistics -
getStats
Returns collection of all statistics held by this bucket. -
clear
public void clear()Removes all statistics from internal storage.
-