Class AtmosphereMetrics

java.lang.Object
org.atmosphere.metrics.AtmosphereMetrics

public final class AtmosphereMetrics extends Object
Micrometer metrics integration for Atmosphere. Registers gauges, counters, and timers for connections, broadcasters, messages, rooms, cache, and backpressure. All metrics use the atmosphere.* prefix. Requires io.micrometer:micrometer-core on the classpath.
  • Method Details

    • install

      public static AtmosphereMetrics install(AtmosphereFramework framework, io.micrometer.core.instrument.MeterRegistry registry)
      Install metrics collection on the given framework.
      Parameters:
      framework - the Atmosphere framework instance
      registry - the Micrometer meter registry
      Returns:
      the metrics instance (for testing or manual removal)
    • instrumentRoom

      public void instrumentRoom(Room room)
      Install room-level presence and message metrics on a specific room.
      Parameters:
      room - the room to instrument
    • instrumentRoomManager

      public void instrumentRoomManager(RoomManager roomManager)
      Install room-level metrics for all rooms managed by a RoomManager. Also registers a gauge for the total active room count.
      Parameters:
      roomManager - the room manager to instrument
    • instrumentCache

      public void instrumentCache(UUIDBroadcasterCache cache)
      Install cache metrics on a UUIDBroadcasterCache instance.

      Registers:

      • atmosphere.cache.size — gauge of total cached messages
      • atmosphere.cache.evictions — counter of cache evictions
      • atmosphere.cache.hits — counter of cache hits
      • atmosphere.cache.misses — counter of cache misses
      Parameters:
      cache - the cache to instrument
    • instrumentBackpressure

      public void instrumentBackpressure(BackpressureInterceptor interceptor)
      Install backpressure metrics on a BackpressureInterceptor instance.

      Registers:

      • atmosphere.backpressure.drops — counter of dropped messages
      • atmosphere.backpressure.disconnects — counter of disconnected clients
      Parameters:
      interceptor - the backpressure interceptor to instrument