Class ProfilerImpl.SurpriseQueue

  • Enclosing class:

    static class ProfilerImpl.SurpriseQueue
    extends java.lang.Object
    A priority queue of the last N surprise values. Accepts a new value if the queue is not yet full, or if its value is greater than the median value over the last N.
    • Field Summary

      Modifier and Type Field Description
      (package private) int count  
      (package private) java.util.Deque<java.lang.Double> deque  
      (package private) java.util.PriorityQueue<java.lang.Double> priorityQueue  
      private int size  
      private int warmUpCount  
    • Constructor Summary

      Constructor Description
      SurpriseQueue​(int warmUpCount, int size)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) boolean isValid()  
      (package private) boolean offer​(double d)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • warmUpCount

        private final int warmUpCount
      • size

        private final int size
      • count

        int count
      • deque

        final java.util.Deque<java.lang.Double> deque
      • priorityQueue

        final java.util.PriorityQueue<java.lang.Double> priorityQueue
    • Constructor Detail

      • SurpriseQueue

        SurpriseQueue​(int warmUpCount,
                      int size)
    • Method Detail

      • toString

        public java.lang.String toString()
        toString in class java.lang.Object
      • isValid

        boolean isValid()
      • offer

        boolean offer​(double d)