Package org.atmosphere.metrics
Class AtmosphereMetrics
java.lang.Object
org.atmosphere.metrics.AtmosphereMetrics
Micrometer metrics integration for Atmosphere.
Registers gauges, counters and timers on an Atmosphere framework instance.
Requires io.micrometer:micrometer-core on the classpath (optional dependency).
Usage
MeterRegistry registry = new SimpleMeterRegistry();
AtmosphereMetrics.install(framework, registry);
Metrics published
atmosphere.connections.active— gauge of active connectionsatmosphere.connections.total— counter of all connections everatmosphere.connections.disconnects— counter of disconnectsatmosphere.broadcasters.active— gauge of active broadcastersatmosphere.messages.broadcast— counter of messages broadcastatmosphere.messages.delivered— counter of messages delivered to resourcesatmosphere.broadcast.timer— timer of broadcast completion latencyatmosphere.rooms.active— gauge of active roomsatmosphere.rooms.members— gauge of room members (tagged by room)atmosphere.rooms.messages— counter of room messages (tagged by room)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 missesatmosphere.backpressure.drops— counter of backpressure dropsatmosphere.backpressure.disconnects— counter of backpressure disconnects
-
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
-