vertx / io.vertx.core.spi.metrics / VertxMetrics

VertxMetrics

interface VertxMetrics : Metrics, Measured

The main Vert.x metrics SPI which Vert.x will use internally. This interface serves two purposes, one to be called by Vert.x itself for events like verticles deployed, timers created, etc. The other to provide Vert.x with other metrics SPI's which will be used for specific components i.e. io.vertx.core.http.HttpServer, io.vertx.core.spi.metrics.EventBusMetrics, etc.

Author
Nick Scavelli

Functions

createMetrics

abstract fun createMetrics(eventBus: EventBus): EventBusMetrics<Any>

Provides the event bus metrics SPI when the event bus is created.

No specific thread and context can be expected when this method is called.

This method should be called only once.

abstract fun createMetrics(server: HttpServer, localAddress: SocketAddress, options: HttpServerOptions): HttpServerMetrics<*, *, *>

Provides the http server metrics SPI when an http server is created.

No specific thread and context can be expected when this method is called.

Note: this method can be called more than one time for the same localAddress when a server is scaled, it is the responsibility of the metrics implementation to eventually merge metrics. In this case the provided server argument can be used to distinguish the different HttpServerMetrics instances.

abstract fun createMetrics(client: HttpClient, options: HttpClientOptions): HttpClientMetrics<*, *, *, *, *>

Provides the http client metrics SPI when an http client has been created.

No specific thread and context can be expected when this method is called.

abstract fun createMetrics(localAddress: SocketAddress, options: NetServerOptions): TCPMetrics<*>

Provides the net server metrics SPI when a net server is created.

No specific thread and context can be expected when this method is called.

Note: this method can be called more than one time for the same localAddress when a server is scaled, it is the responsibility of the metrics implementation to eventually merge metrics. In this case the provided server argument can be used to distinguish the different TCPMetrics instances.

abstract fun createMetrics(options: NetClientOptions): TCPMetrics<*>

Provides the net client metrics SPI when a net client is created.

No specific thread and context can be expected when this method is called.

abstract fun createMetrics(socket: DatagramSocket, options: DatagramSocketOptions): DatagramSocketMetrics

Provides the datagram/udp metrics SPI when a datagram socket is created.

No specific thread and context can be expected when this method is called.

abstract fun <P : Any> createMetrics(pool: P, poolType: String, poolName: String, maxPoolSize: Int): PoolMetrics<*>

Provides the pool metrics SPI.

eventBusInitialized

open fun eventBusInitialized(bus: EventBus): Unit

Metrics cannot use the event bus in their constructor as the event bus is not yet initialized. When the event bus is initialized, this method is called with the event bus instance as parameter. By default, this method does nothing.

timerCreated

abstract fun timerCreated(id: Long): Unit

Called when a timer is created

No specific thread and context can be expected when this method is called.

timerEnded

abstract fun timerEnded(id: Long, cancelled: Boolean): Unit

Called when a timer has ended (setTimer) or has been cancelled.

No specific thread and context can be expected when this method is called.

verticleDeployed

abstract fun verticleDeployed(verticle: Verticle): Unit

Called when a verticle is deployed in Vert.x .

This method is invoked with io.vertx.core.Context and thread of the deployed verticle and therefore might be different on every invocation.

verticleUndeployed

abstract fun verticleUndeployed(verticle: Verticle): Unit

Called when a verticle is undeployed in Vert.x .

This method is invoked with io.vertx.core.Context and thread of the deployed verticle and therefore might be different on every invocation, however these are the same than the #verticleDeployed invocation.