Class AbstractTimingStore

  • Direct Known Subclasses:
    AbstractPolicyTimingStore, SessionMonitoringTimingStore

    public abstract class AbstractTimingStore
    extends Object
    An abstract store for holding a set of TimingEntrys. 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 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.
    • Constructor Detail

      • AbstractTimingStore

        public AbstractTimingStore​(int maxEntries)
        Constructs a new AbstractTimingStore instance.
        Parameters:
        maxEntries - The maximum number of entries.
    • 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