Monitor Life Cycles

A monitor goes through the following states:

  • WAITING—waiting for timer to go off
  • COLLECTING_QUEUE—queued waiting to start collecting
  • COLLECTING—collecting data
  • REPORTING_QUEUE—queued waiting to start reporting
  • REPORTING—reporting collected data
  • STOPPING—stopping the view, waiting for COLLECTING_QUEUE, COLLECTING, REPORTING_QUEUE, REPORTING to finish
  • STOPPED—the monitor is stopped

The following steps describe a typical monitor life cycle and how the agent framework interacts with different methods and members in the monitor class:

  1. The Solace Geneos Agent service invokes the initialize() method; the monitor is loaded and is in STOPPED state. If the monitor is configured to auto start, then the start() method is called.
  2. If autoStart is false, the monitor stays at STOPPED state. Otherwise, a data sampling task is added to the Monitor Timer thread shared by all monitors based on the monitor’s sampling rate, and its state changes to WAITING state.
  3. When the timer goes off, the monitor enqueues a collection task onto the collecting context and the monitor transitions to COLLECTING_QUEUE state.
  4. The collecting context changes the monitor state to COLLECTING state and invokes the monitor’s onCollect() method to collect data.
  5. When collecting is complete, the monitor enqueues a reporting task onto the reporting context, and the monitor transitions to REPORTING_QUEUE state.
  6. The reporting context changes the monitor state to REPORTING state, and invokes the monitor’s onReport() method to send data to NetProbes.
  7. When the reporting is complete, the monitor transitions back to WAITING state.
  8. If an error occurs during collecting or reporting, the monitor transitions to WAITING state. An error is logged; if it is enabled, the proper statistic (for example, numAbortedIntervals) is incremented.

The monitor can be stopped and started through JMX through the start() or stop() methods. When the monitor is stopped, it transitions from STOPPING state to STOPPED state when all outstanding tasks are completed or canceled.