Class MultiClusterStatsRecorder

java.lang.Object
org.openspaces.core.multicluster.internal.MultiClusterStatsRecorder
All Implemented Interfaces:
MultiClusterStats

public final class MultiClusterStatsRecorder extends Object implements MultiClusterStats
The recording side of MultiClusterStats. Not API - the application sees only the read-only interface, through MultiClusterGigaSpace.getStats().

Recording happens on the data path, so it uses LongAdders and a single CAS for the latency average - no locks, no allocation per operation. Reading produces an immutable MultiClusterStats.Snapshot.

  • Constructor Details

    • MultiClusterStatsRecorder

      public MultiClusterStatsRecorder()
  • Method Details

    • recordSuccess

      public void recordSuccess(String cluster, long durationNanos)
      Records a successful operation and folds its duration into the cluster's moving average.
    • recordFailure

      public void recordFailure(String cluster)
      Records an operation that failed because the cluster was unavailable.
    • recordApplicationError

      public void recordApplicationError(String cluster)
      Records an operation the cluster rejected on its own merits - a duplicate id, an invalid query. Counted separately from failures on purpose: treating these as cluster failures would let one repeated bad call fail an entire site over.
    • recordQuiesceRejection

      public void recordQuiesceRejection(String cluster)
      Records an operation rejected because the cluster is quiesced - not a health failure.
    • recordDeferredMutation

      public void recordDeferredMutation(String cluster)
      Records a mutation queued for later re-application (async fan-out or quiesce retry).
    • track

      public void track(String cluster)
      Makes a cluster visible in snapshots before it has served anything.
    • forget

      public void forget(String cluster)
      Drops a cluster's counters, for use when it is unregistered.
    • snapshot

      public MultiClusterStats.Snapshot snapshot(String cluster)
      Description copied from interface: MultiClusterStats
      Current counters for one cluster, or null if that cluster is unknown.
      Specified by:
      snapshot in interface MultiClusterStats
    • snapshots

      public List<MultiClusterStats.Snapshot> snapshots()
      Description copied from interface: MultiClusterStats
      Current counters for every tracked cluster, ordered by name for stable output.
      Specified by:
      snapshots in interface MultiClusterStats
    • toString

      public String toString()
      Overrides:
      toString in class Object