Class CountingCircuitStats

  • All Implemented Interfaces:
    CircuitStats

    class CountingCircuitStats
    extends java.lang.Object
    implements CircuitStats
    A CircuitStats implementation that counts execution results using a BitSet.
    • Field Detail

      • bitSet

        final java.util.BitSet bitSet
      • size

        private final int size
      • currentIndex

        volatile int currentIndex
        Index to write next entry to
      • occupiedBits

        private volatile int occupiedBits
      • successes

        private volatile int successes
      • failures

        private volatile int failures
    • Constructor Detail

      • CountingCircuitStats

        public CountingCircuitStats​(int size,
                                    CircuitStats oldStats)
    • Method Detail

      • copyStats

        void copyStats​(CircuitStats oldStats)
        Copies the most recent stats from the oldStats into this in order from oldest to newest.
      • setNext

        int setNext​(boolean value)
        Sets the value of the next bit in the bitset, returning the previous value, else -1 if no previous value was set for the bit.
        Parameters:
        value - true if positive/success, false if negative/failure
      • toString

        public java.lang.String toString()
        Returns an array representation of the BitSet entries.
        Overrides:
        toString in class java.lang.Object
      • indexAfter

        private int indexAfter​(int index)
        Returns the index after the index.