Package org.atmosphere.metrics
Class AtmosphereMetrics
java.lang.Object
org.atmosphere.metrics.AtmosphereMetrics
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 Summary
Modifier and TypeMethodDescriptionstatic AtmosphereMetricsinstall(AtmosphereFramework framework, io.micrometer.core.instrument.MeterRegistry registry) Install metrics collection on the given framework.voidinstrumentBackpressure(BackpressureInterceptor interceptor) Install backpressure metrics on aBackpressureInterceptorinstance.voidInstall cache metrics on aUUIDBroadcasterCacheinstance.voidinstrumentRoom(Room room) Install room-level presence and message metrics on a specific room.voidinstrumentRoomManager(RoomManager roomManager) Install room-level metrics for all rooms managed by a RoomManager.
-
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 instanceregistry- the Micrometer meter registry- Returns:
- the metrics instance (for testing or manual removal)
-
instrumentRoom
Install room-level presence and message metrics on a specific room.- Parameters:
room- the room to instrument
-
instrumentRoomManager
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
Install cache metrics on aUUIDBroadcasterCacheinstance.Registers:
atmosphere.cache.size— gauge of total cached messagesatmosphere.cache.evictions— counter of cache evictionsatmosphere.cache.hits— counter of cache hitsatmosphere.cache.misses— counter of cache misses
- Parameters:
cache- the cache to instrument
-
instrumentBackpressure
Install backpressure metrics on aBackpressureInterceptorinstance.Registers:
atmosphere.backpressure.drops— counter of dropped messagesatmosphere.backpressure.disconnects— counter of disconnected clients
- Parameters:
interceptor- the backpressure interceptor to instrument
-