Class TimedBuffer

    • Constructor Detail

      • TimedBuffer

        public TimedBuffer​(CriticalAnalyzer analyzer,
                           int size,
                           int timeout,
                           boolean logRates)
    • Method Detail

      • start

        public void start()
      • stop

        public void stop()
      • checkSize

        public boolean checkSize​(int sizeChecked)
        Verify if the size fits the buffer
        Parameters:
        sizeChecked -
      • flush

        public void flush()
      • flushBatch

        public boolean flushBatch()
        Attempts to flush if !delayFlush and buffer is filled by any data.
        Returns:
        true when are flushed any bytes, false otherwise
      • sleep

        protected void sleep​(long sleepNanos)
        Sub classes (tests basically) can use this to override how the sleep is being done
        Parameters:
        sleepNanos -
      • stopSpin

        protected void stopSpin()
        Sub classes (tests basically) can use this to override disabling spinning
      • startSpin

        protected void startSpin()
        Sub classes (tests basically) can use this to override disabling spinning