Class AbstractTimingStore
- java.lang.Object
-
- org.forgerock.openam.shared.monitoring.AbstractTimingStore
-
- Direct Known Subclasses:
AbstractPolicyTimingStore,SessionMonitoringTimingStore
public abstract class AbstractTimingStore extends Object
An abstract store for holding a set ofTimingEntrys. The maximum size of the store is set on creation. The store internally uses a synchronizedList, which verifies the size of the collection isn't greater than the maximum upon insertion, and removes the oldest entry if it is. Read operations are not synchronized.
-
-
Field Summary
Fields Modifier and Type Field Description protected List<TimingEntry>durationStoreThe duration store, limited to the number of entries specified by the configuration set by administrator.protected intmaxEntriesThe maximum number of entries allowed.
-
Constructor Summary
Constructors Constructor Description AbstractTimingStore(int maxEntries)Constructs a new AbstractTimingStore instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetDurationAverage()Getter for the average length of time events recorded in the duration store have taken.intgetMaxEntries()Returns the maximum entries for this store.StringgetSlowestEvaluation()Returns a string representation of the slowest performing policy evaluation.longgetSlowestEvaluationDuration()Returns the long representation of the slowest performing policy evaluation.
-
-
-
Field Detail
-
maxEntries
protected final int maxEntries
The maximum number of entries allowed.
-
durationStore
protected final List<TimingEntry> durationStore
The duration store, limited to the number of entries specified by the configuration set by administrator.
-
-
Method Detail
-
getDurationAverage
public long getDurationAverage()
Getter for the average length of time events recorded in the duration store have taken.- Returns:
- a long representation of the average length of time in ms.
-
getSlowestEvaluation
public String getSlowestEvaluation()
Returns a string representation of the slowest performing policy evaluation. If no policy evaluations have yet been run, this will return the empty String.- Returns:
- representation of the slowest performing policy evaluation.
-
getSlowestEvaluationDuration
public long getSlowestEvaluationDuration()
Returns the long representation of the slowest performing policy evaluation. If no policy evaluations have yet been run, this will return 0.- Returns:
- duration of the slowest performing policy evaluation in ms.
-
getMaxEntries
public int getMaxEntries()
Returns the maximum entries for this store.- Returns:
- the maximum number of entries this timing store will hold before removing the oldest entry
-
-