Class PublisherBase

java.lang.Object
org.eso.ias.plugin.publisher.PublisherBase
All Implemented Interfaces:
MonitorPointSender
Direct Known Subclasses:
BufferedPublisherBase, KafkaPublisher, ListenerPublisher

public abstract class PublisherBase extends Object implements MonitorPointSender
Base class for publishing data to the core of the IAS: received monitor points are queued to be sent when
  • the time interval (throttlingTime) elapses or
  • the max allowed size of the buffer has been reached

PublisherBase gets all the values from the monitored system and saves them in a map (the buffer) until the throttling time expires or the max allowed size has been reached and only then sends all of them at once. The map allows to easily save only the last update value for each managed monitor point preventing a misbehaving plugin to fire tons of messages per time interval. Monitor point values are sent one by one to the core of the IAS.

Reaching the max size of the buffer, triggers the immediate sending of the values of the monitor points. The periodic thread will continue to run.

Life cyle:

  • start() is the first method to call to allow a correct initialization.
  • shutdown() must be called when down with this object to clean the resources
Author:
acaproni
  • Field Details

    • THROTTLING_PROPNAME

      public static final String THROTTLING_PROPNAME
      The name of the property to set the throttling sending values to the IAS (100<=msec<=1000)
      See Also:
    • defaultThrottlingTime

      public static final long defaultThrottlingTime
      The default throttling time in millisecond
      See Also:
    • throttlingTime

      public static final long throttlingTime
    • MAX_BUFFER_SIZE_PROPNAME

      public static final String MAX_BUFFER_SIZE_PROPNAME
      The name of the property to set max dimension of monitor points to buffer
      See Also:
    • defaultBufferSize

      public static final int defaultBufferSize
      The default max size of the buffer
      See Also:
    • maxBufferSize

      public static final int maxBufferSize
      The max number of monitor point values to keep in memory in the time interval.

      If the size of the buffer is greater or equal the maxBufferSize, the monitor point values are sent immediately to the core of the IAS

    • pluginId

      public final String pluginId
      The ID of the plugin.
    • monitoredSystemId

      public final String monitoredSystemId
      The ID of the system monitored by the plugin.
    • monitorPoints

      protected final Map<String,ValueToSend> monitorPoints
      The map to store the monitor points received during the throttling time interval.

      A map allows to save only the last received update of a monitor point if a misbehaving implementation is continuously updating a value.

      The key is the ID of the monitor point, the value is the FilteredValue as returned applying the filter to a set of samples.

    • iso8601dateFormat

      protected final SimpleDateFormat iso8601dateFormat
      ISO 8601 date formatter
    • publishedMessages

      protected final AtomicLong publishedMessages
      The number of messages sent to the core of the IAS
    • monitorPointsSent

      protected final AtomicLong monitorPointsSent
      The number of monitor point values sent to the core of the IAS
    • numOfErrorsSending

      protected final AtomicLong numOfErrorsSending
      The number of errors while sending monitor point values to the core of the IAS
  • Constructor Details

    • PublisherBase

      public PublisherBase(String pluginId, String monitoredSystemId, ScheduledExecutorService executorSvc)
      Constructor
      Parameters:
      pluginId - The identifier of the plugin
      monitoredSystemId - The identifier of the system monitored by the plugin
      executorSvc - The executor service
  • Method Details