io.vertx.core.spi.metrics

## Interface VertxMetrics

- All Superinterfaces:
    Measured, Metrics

      public interface VertxMetrics
      extends 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. `HttpServer`, `EventBusMetrics`, etc.
  Author:
    Nick Scavelli

- - ### Field Summary

    - ### Fields inherited from interface io.vertx.core.spi.metrics.Metrics

      `DISABLE_METRICS_PROPERTY_NAME, METRICS_ENABLED`

  - ### Method Summary

    All Methods Instance Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `default DatagramSocketMetrics` | `createDatagramSocketMetrics(DatagramSocketOptions options)` Provides the datagram/udp metrics SPI when a datagram socket is created.
    `default EventBusMetrics` | `createEventBusMetrics()` Provides the event bus metrics SPI when the event bus is created.
    `default HttpClientMetrics<?,?,?,?,?>` | `createHttpClientMetrics(HttpClientOptions options)` Provides the http client metrics SPI when an http client has been created.
    `default HttpServerMetrics<?,?,?>` | `createHttpServerMetrics(HttpServerOptions options, SocketAddress localAddress)` Provides the http server metrics SPI when an http server is created.
    `default TCPMetrics<?>` | `createNetClientMetrics(NetClientOptions options)` Provides the net client metrics SPI when a net client is created.
    `default TCPMetrics<?>` | `createNetServerMetrics(NetServerOptions options, SocketAddress localAddress)` Provides the net server metrics SPI when a net server is created.
    `default PoolMetrics<?>` | `createPoolMetrics(String poolType, String poolName, int maxPoolSize)` Provides the pool metrics SPI.
    `default void` | `timerCreated(long id)` Called when a timer is created
    `default void` | `timerEnded(long id, boolean cancelled)` Called when a timer has ended (setTimer) or has been cancelled.
    `default void` | `verticleDeployed(Verticle verticle)` Called when a verticle is deployed in Vert.x .
    `default void` | `verticleUndeployed(Verticle verticle)` Called when a verticle is undeployed in Vert.x .
    `default void` | `vertxCreated(Vertx vertx)` Callback to signal when the Vertx instance is fully initialized.

    - ### Methods inherited from interface io.vertx.core.spi.metrics.Metrics

      `close, isEnabled`

    - ### Methods inherited from interface io.vertx.core.metrics.Measured

      `isMetricsEnabled`

- - ### Method Detail

    - #### verticleDeployed

          default void verticleDeployed(Verticle verticle)

      Called when a verticle is deployed in Vert.x .

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

      Parameters:
        `verticle` - the verticle which was deployed

    - #### verticleUndeployed

          default void verticleUndeployed(Verticle verticle)

      Called when a verticle is undeployed in Vert.x .

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

      Parameters:
        `verticle` - the verticle which was undeployed

    - #### timerCreated

          default void timerCreated(long id)

      Called when a timer is created

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

      Parameters:
        `id` - the id of the timer

    - #### timerEnded

          default void timerEnded(long id,
                                  boolean cancelled)

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

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

      Parameters:
        `id` - the id of the timer
        `cancelled` - if the timer was cancelled by the user

    - #### createEventBusMetrics

          default EventBusMetrics createEventBusMetrics()

      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.

      Returns:
        the event bus metrics SPI or `null` when metrics are disabled

    - #### createHttpServerMetrics

          default HttpServerMetrics<?,?,?> createHttpServerMetrics(HttpServerOptions options,
                                                                   SocketAddress localAddress)

      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.

      Parameters:
        `options` - the options used to create the `HttpServer`
        `localAddress` - localAddress the local address the net socket is listening on
      Returns:
        the http server metrics SPI or `null` when metrics are disabled

    - #### createHttpClientMetrics

          default HttpClientMetrics<?,?,?,?,?> createHttpClientMetrics(HttpClientOptions options)

      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.

      Parameters:
        `options` - the options used to create the `HttpClient`
      Returns:
        the http client metrics SPI or `null` when metrics are disabled

    - #### createNetServerMetrics

          default TCPMetrics<?> createNetServerMetrics(NetServerOptions options,
                                                       SocketAddress localAddress)

      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.

      Parameters:
        `options` - the options used to create the `NetServer`
        `localAddress` - localAddress the local address the net socket is listening on
      Returns:
        the net server metrics SPI or `null` when metrics are disabled

    - #### createNetClientMetrics

          default TCPMetrics<?> createNetClientMetrics(NetClientOptions options)

      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.

      Parameters:
        `options` - the options used to create the `NetClient`
      Returns:
        the net client metrics SPI or `null` when metrics are disabled

    - #### createDatagramSocketMetrics

          default DatagramSocketMetrics createDatagramSocketMetrics(DatagramSocketOptions options)

      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.

      Parameters:
        `options` - the options used to create the `DatagramSocket`
      Returns:
        the datagram metrics SPI or `null` when metrics are disabled

    - #### createPoolMetrics

          default PoolMetrics<?> createPoolMetrics(String poolType,
                                                   String poolName,
                                                   int maxPoolSize)

      Provides the pool metrics SPI.
      Parameters:
        `poolType` - the type of the pool e.g worker, datasource, etc..
        `poolName` - the name of the pool
        `maxPoolSize` - the pool max size, or -1 if the number cannot be determined
      Returns:
        the thread pool metrics SPI or `null` when metrics are disabled

    - #### vertxCreated

          default void vertxCreated(Vertx vertx)

      Callback to signal when the Vertx instance is fully initialized. Other methods can be called before this method when the instance is being constructed.
      Parameters:
        `vertx` - the instance of Vertx

Copyright © 2019 Eclipse. All rights reserved.