Class MetricService
java.lang.Object
org.nanonative.nano.core.model.Service
org.nanonative.nano.services.metric.logic.MetricService
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected Stringstatic final Channel<MetricUpdate, Void> protected Stringprotected Stringprotected StringFields inherited from class org.nanonative.nano.core.model.Service
context, createdAtNs, isReady -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddMetricsEndpoint(Event<?, ?> event) voidconfigure(berlin.yuna.typemap.model.TypeMapI<?> configs, berlin.yuna.typemap.model.TypeMapI<?> merged) Configures the service with changes while maintaining merged state.longinflux()metrics()voidProcesses incoming events for the service.Handles service failures and errors.voidstart()Starts the service.voidstop()Stops the service gracefully.voidupdateArch(Context context) voidupdateBufferMetrics(Supplier<Context> context) voidupdateClassLoaderMetrics(Supplier<Context> context) voidupdateCompilerMetrics(Nano nano) voidupdateCpuMetrics(Supplier<Context> context) voidupdateDeadlockMetrics(Supplier<Context> context) voidupdateDiscMetrics(Supplier<Context> context) voidupdateJavaVersion(Context context) voidupdateMemoryMetrics(Supplier<Context> context) booleanupdateMetric(MetricUpdate metric) updateMetrics(Nano nano) voidupdateNanoMetrics(Nano nano) voidvoidupdatePoolMetrics(Supplier<Context> context) voidupdateSystemMetrics(Context context) voidupdateThreadMetrics(Supplier<Context> context) Methods inherited from class org.nanonative.nano.core.model.Service
configure, context, context, createdAtNs, isReady, isReadyState, name, nanoThread, receiveEvent, threadsOf
-
Field Details
-
prometheusPath
-
dynamoPath
-
influx
-
wavefront
-
CONFIG_METRIC_SERVICE_BASE_PATH
-
CONFIG_METRIC_SERVICE_PROMETHEUS_PATH
-
CONFIG_METRIC_SERVICE_INFLUX_PATH
-
CONFIG_METRIC_SERVICE_WAVEFRONT_PATH
-
CONFIG_METRIC_SERVICE_DYNAMO_PATH
-
EVENT_METRIC_UPDATE
-
-
Constructor Details
-
MetricService
public MetricService()
-
-
Method Details
-
start
public void start()Description copied from class:ServiceStarts 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 alsoService.configure(TypeMapI, TypeMapI)for configuration setup. -
stop
public void stop()Description copied from class:ServiceStops 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 -
onFailure
Description copied from class:ServiceHandles 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 -
onEvent
Description copied from class:ServiceProcesses 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 -
configure
public void configure(berlin.yuna.typemap.model.TypeMapI<?> configs, berlin.yuna.typemap.model.TypeMapI<?> merged) Description copied from class:ServiceConfigures 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:
configurein classService- Parameters:
configs- The new configuration changes to applymerged- The complete merged configuration state - this will be represented inService.contextafter the method is done
-
addMetricsEndpoint
-
updateMetric
-
metrics
-
updateMetrics
-
updateCompilerMetrics
-
updateClassLoaderMetrics
-
updateBufferMetrics
-
updateThreadMetrics
-
updatePoolMetrics
-
updateMemoryMetrics
-
updateDiscMetrics
-
updateCpuMetrics
-
updateDeadlockMetrics
-
updateNanoMetrics
-
updateSystemMetrics
-
updateOs
-
updateArch
-
updateJavaVersion
-
estimateMetricCacheSize
public long estimateMetricCacheSize() -
prometheusPath
-
dynamoPath
-
influx
-
wavefront
-