Class MetricService

java.lang.Object
org.nanonative.nano.core.model.Service
org.nanonative.nano.services.metric.logic.MetricService

public class MetricService extends Service
  • Field Details

    • prometheusPath

      protected String prometheusPath
    • dynamoPath

      protected String dynamoPath
    • influx

      protected String influx
    • wavefront

      protected String wavefront
    • CONFIG_METRIC_SERVICE_BASE_PATH

      public static final String CONFIG_METRIC_SERVICE_BASE_PATH
    • CONFIG_METRIC_SERVICE_PROMETHEUS_PATH

      public static final String CONFIG_METRIC_SERVICE_PROMETHEUS_PATH
    • CONFIG_METRIC_SERVICE_INFLUX_PATH

      public static final String CONFIG_METRIC_SERVICE_INFLUX_PATH
    • CONFIG_METRIC_SERVICE_WAVEFRONT_PATH

      public static final String CONFIG_METRIC_SERVICE_WAVEFRONT_PATH
    • CONFIG_METRIC_SERVICE_DYNAMO_PATH

      public static final String CONFIG_METRIC_SERVICE_DYNAMO_PATH
    • EVENT_METRIC_UPDATE

      public static final Channel<MetricUpdate,Void> EVENT_METRIC_UPDATE
  • Constructor Details

    • MetricService

      public MetricService()
  • Method Details

    • start

      public void start()
      Description copied from class: Service
      Starts the service. This method is called during service initialization. Optional implementation - services can leave this empty if no startup logic is needed. Common uses include: - Initializing resources - Setting up connections - Starting background tasks See also Service.configure(TypeMapI, TypeMapI) for configuration setup.
      Specified by:
      start in class Service
    • stop

      public void stop()
      Description copied from class: Service
      Stops the service gracefully. This method is called during service shutdown. Optional implementation - services can leave this empty if no cleanup is needed. Common uses include: - Closing connections - Releasing resources - Stopping background tasks
      Specified by:
      stop in class Service
    • onFailure

      public Object onFailure(Event<?,?> error)
      Description copied from class: Service
      Handles service failures and errors. Optional implementation - services can return null if no specific error handling is needed. Null means the error will be logged automatically if no other listener or service handles it. Useful for: - Custom error recovery strategies - Error logging - Notifying other components of failures
      Specified by:
      onFailure in class Service
      Parameters:
      error - The error event to handle
      Returns:
      Response object from error handling, can be null
    • onEvent

      public void onEvent(Event<?,?> event)
      Description copied from class: Service
      Processes incoming events for the service. Optional implementation - services can leave this empty if they don't need to handle events. Useful for: - Responding to system events - Inter-service communication - State updates based on external triggers
      Specified by:
      onEvent in class Service
      Parameters:
      event - The event to process
    • configure

      public void configure(berlin.yuna.typemap.model.TypeMapI<?> configs, berlin.yuna.typemap.model.TypeMapI<?> merged)
      Description copied from class: Service
      Configures the service with changes while maintaining merged state. Optional implementation - services can leave this empty if no configuration is needed. Useful for: - Service initialization with configuration - Handling dynamic configuration updates - Managing service state - Applying configuration changes without service restart
      Specified by:
      configure in class Service
      Parameters:
      configs - The new configuration changes to apply
      merged - The complete merged configuration state - this will be represented in Service.context after the method is done
    • addMetricsEndpoint

      protected void addMetricsEndpoint(Event<?,?> event)
    • updateMetric

      public boolean updateMetric(MetricUpdate metric)
    • metrics

      public MetricCache metrics()
    • updateMetrics

      public MetricService updateMetrics(Nano nano)
    • updateCompilerMetrics

      public void updateCompilerMetrics(Nano nano)
    • updateClassLoaderMetrics

      public void updateClassLoaderMetrics(Supplier<Context> context)
    • updateBufferMetrics

      public void updateBufferMetrics(Supplier<Context> context)
    • updateThreadMetrics

      public void updateThreadMetrics(Supplier<Context> context)
    • updatePoolMetrics

      public void updatePoolMetrics(Supplier<Context> context)
    • updateMemoryMetrics

      public void updateMemoryMetrics(Supplier<Context> context)
    • updateDiscMetrics

      public void updateDiscMetrics(Supplier<Context> context)
    • updateCpuMetrics

      public void updateCpuMetrics(Supplier<Context> context)
    • updateDeadlockMetrics

      public void updateDeadlockMetrics(Supplier<Context> context)
    • updateNanoMetrics

      public void updateNanoMetrics(Nano nano)
    • updateSystemMetrics

      public void updateSystemMetrics(Context context)
    • updateOs

      public void updateOs(Context context)
    • updateArch

      public void updateArch(Context context)
    • updateJavaVersion

      public void updateJavaVersion(Context context)
    • estimateMetricCacheSize

      public long estimateMetricCacheSize()
    • prometheusPath

      public String prometheusPath()
    • dynamoPath

      public String dynamoPath()
    • influx

      public String influx()
    • wavefront

      public String wavefront()