Interface MetricsService

  • All Known Implementing Classes:
    MetricsServiceImpl

    @Contract
    public interface MetricsService
    The API to use MetricRegistrys within an multi-application environment. The main purpose of this API is to cleanly decouple the users from the service provider and to avoid API pollution with methods that might be added to test or integrate the implementation but should not be called anywhere else.
    Since:
    5.2020.8
    Author:
    Jan Bernitt
    • Method Detail

      • refresh

        void refresh()
        Triggers update of internal state usually used after configuration changes that can have the effect that metrics appear or disappear in a way that is detected by the registry.
      • getContext

        MetricsService.MetricsContext getContext​(boolean createIfNotExists)
        Access current application metric context. If this is called from a context that is not linked to an application context the server context is returned.
        Parameters:
        createIfNotExists - true to create the requested context in case it did not exist, false to instead return null in that case
        Returns:
        the existing or created context or null if it did not exist and parameter was false or if the servicenot isEnabled()