Class Buffer

java.lang.Object
io.prometheus.metrics.core.metrics.Buffer

class Buffer extends Object
Metrics support concurrent write and scrape operations.

This is implemented by switching to a Buffer when the scrape starts, and applying the values from the buffer after the scrape ends.

  • Field Details

    • bufferActiveBit

      private static final long bufferActiveBit
      See Also:
    • stripedObservationCounts

      private final AtomicLong[] stripedObservationCounts
    • observationBuffer

      private double[] observationBuffer
    • bufferPos

      private int bufferPos
    • reset

      private boolean reset
    • appendLock

      ReentrantLock appendLock
    • runLock

      ReentrantLock runLock
    • bufferFilled

      Condition bufferFilled
  • Constructor Details

    • Buffer

      Buffer()
  • Method Details

    • append

      boolean append(double value)
    • doAppend

      private void doAppend(double amount)
    • reset

      void reset()
      Must be called by the runnable in the run() method.
    • run

      <T extends DataPointSnapshot> T run(Function<Long,Boolean> complete, Supplier<T> createResult, Consumer<Double> observeFunction)