Class MetricsCollector.NotificationSnapshot

java.lang.Object
com.pyranid.MetricsCollector.NotificationSnapshot
Enclosing interface:
MetricsCollector

@ThreadSafe public static final class MetricsCollector.NotificationSnapshot extends Object
Counter snapshot for notification metrics.

Implementations may read counters independently without cross-counter atomicity. Callers that need invariant-consistent snapshots should drain in-flight work before reading.

Instances are immutable value objects created through of(Long, Long, Long, Long, Long, Long, Long). Future releases may add counters and accessors while retaining this factory with defined defaults for any newly added values.

Since:
4.6.0
Author:
Mark Allen
  • Method Details

    • of

      public static @NonNull MetricsCollector.NotificationSnapshot of(@NonNull Long sessionsStarted, @NonNull Long sessionsOpened, @NonNull Long sessionsCallbackReturned, @NonNull Long sessionsInterrupted, @NonNull Long sessionsFailed, @NonNull Long batchesDelivered, @NonNull Long notificationsDelivered)
      Creates a notification metrics snapshot.
      Parameters:
      sessionsStarted - valid, type-resolved notification-session invocations that entered measured setup
      sessionsOpened - notification sessions that completed channel registration
      sessionsCallbackReturned - opened notification sessions whose callbacks returned and cleanup completed normally
      sessionsInterrupted - opened notification sessions that ended through clean cooperative interruption
      sessionsFailed - notification-session invocations that failed before opening or after opening
      batchesDelivered - nonempty notification batches delivered to application code
      notificationsDelivered - notifications contained in delivered batches
      Returns:
      notification metrics snapshot
      Throws:
      NullPointerException - if any counter is null
      Since:
      4.6.0
    • sessionsStarted

      public @NonNull Long sessionsStarted()
      Returns:
      valid, type-resolved notification-session invocations that entered measured setup
      Since:
      4.6.0
    • sessionsOpened

      public @NonNull Long sessionsOpened()
      Returns:
      notification sessions that completed channel registration
      Since:
      4.6.0
    • sessionsCallbackReturned

      public @NonNull Long sessionsCallbackReturned()
      Returns:
      opened notification sessions whose callbacks returned and cleanup completed normally
      Since:
      4.6.0
    • sessionsInterrupted

      public @NonNull Long sessionsInterrupted()
      Returns:
      opened notification sessions that ended through clean cooperative interruption
      Since:
      4.6.0
    • sessionsFailed

      public @NonNull Long sessionsFailed()
      Returns:
      notification-session invocations that failed before opening or after opening
      Since:
      4.6.0
    • batchesDelivered

      public @NonNull Long batchesDelivered()
      Returns:
      nonempty notification batches delivered to application code
      Since:
      4.6.0
    • notificationsDelivered

      public @NonNull Long notificationsDelivered()
      Returns:
      notifications contained in delivered batches
      Since:
      4.6.0
    • equals

      public boolean equals(@Nullable Object object)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public @NonNull String toString()
      Overrides:
      toString in class Object