Interface HealthService<T>

All Known Implementing Classes:
ServiceHealthAggregator

public interface HealthService<T>
An interface which can be used to track the health of any service You can add a set of monitors, and a general health will be tracked by
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Add a monitor which will be run in the same thread.
    void
    Register a monitor to the service, to setup a continuous monitoring on the monitor this method can be used to add a IsolatedHealthMonitor which will later be scheduled at regular intervals and monitored to generate and maintain an aggregated health of the service the scheduling will happen in an isolated thread
    aggregate all registered (enabled) monitors, collect individual monitor healths, and aggregate them accordingly
    void
    Start monitoring all registered monitors.
    void
    Stop the health service, and stop tracking all monitors
  • Method Details

    • addIsolatedMonitor

      void addIsolatedMonitor(IsolatedHealthMonitor<T> monitor)
      Register a monitor to the service, to setup a continuous monitoring on the monitor this method can be used to add a IsolatedHealthMonitor which will later be scheduled at regular intervals and monitored to generate and maintain an aggregated health of the service the scheduling will happen in an isolated thread
      Parameters:
      monitor - an implementation of the IsolatedHealthMonitor
    • addInlineMonitor

      void addInlineMonitor(Monitor<T> monitor)
      Add a monitor which will be run in the same thread. this method can be used to add a Monitor this monitor will not be scheduled in a separate isolated thread, but instead its execution will happen inline, in a single thread, along with other inline monitors
      Parameters:
      monitor - an implementation of line Monitor
    • start

      void start()
      Start monitoring all registered monitors. Start individual monitors
    • stop

      void stop()
      Stop the health service, and stop tracking all monitors
    • getServiceHealth

      T getServiceHealth()
      aggregate all registered (enabled) monitors, collect individual monitor healths, and aggregate them accordingly
      Returns:
      the aggregated health of the service