com.tibco.cep.runtime.appmetrics

## Interface MetricsStoreProvider

-     public interface MetricsStoreProvider

  A metrics store provider is used by BusinessEvents inference agent to publish application metrics. The provider is initialized with configuration, manages client connection, provides a metric record builder to construct metric records. The metric records are published to the metric store using client specific transport protocol and formats. The client resource must be released on shutdown.
  Since:
    6.1.0

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Close connection and release associated resources.
    `void` | `connect()` Connect or verify connection to metrics store.
    `void` | `init(AppMetricsConfig config)` Initialize resources with design-time configuration properties.
    `void` | `publish(java.util.Iterator iterator)` Iterate and publish each `MetricRecord` to the target store.
    `void` | `reconnectOnError(java.lang.Exception e)` Reconnect metrics store on error while publishing metric.

- - ### Method Detail

    - #### init

          void init(AppMetricsConfig config)

      Initialize resources with design-time configuration properties. The configuration provides access to configuration including connection, security properties and configured entities.
      Parameters:
        `config` - `AppMetricsConfig`
      Throws:
        `java.lang.Exception`

    - #### connect

          void connect()

      Connect or verify connection to metrics store.
      Throws:
        `java.lang.Exception`

    - #### reconnectOnError

          void reconnectOnError(java.lang.Exception e)

      Reconnect metrics store on error while publishing metric.
      Parameters:
        `Exception` -
      Throws:
        `java.lang.Exception`

    - #### publish

          void publish(java.util.Iterator iterator)

      Iterate and publish each `MetricRecord` to the target store. The implementations should use an store specific client to publish each record individually or as a batch.
      Parameters:
        `iterator` - - MetricRecord iterator.
      Throws:
        `java.lang.Exception`

    - #### close

          void close()

      Close connection and release associated resources.
      Throws:
        `java.lang.Exception`