Class HibernateMetrics

  • All Implemented Interfaces:
    io.micrometer.core.instrument.binder.MeterBinder

    @NonNullApi
    @NonNullFields
    public class HibernateMetrics
    extends Object
    implements io.micrometer.core.instrument.binder.MeterBinder
    A MeterBinder implementation that provides Hibernate metrics. It exposes the same statistics as would be exposed when calling Statistics.logSummary().
    • Constructor Detail

      • HibernateMetrics

        public HibernateMetrics​(SessionFactory sessionFactory,
                                String sessionFactoryName,
                                Iterable<io.micrometer.core.instrument.Tag> tags)
        Create a HibernateMetrics.
        Parameters:
        sessionFactory - session factory to use
        sessionFactoryName - session factory name as a tag value
        tags - additional tags
    • Method Detail

      • monitor

        public static void monitor​(io.micrometer.core.instrument.MeterRegistry registry,
                                   SessionFactory sessionFactory,
                                   String sessionFactoryName,
                                   String... tags)
        Create HibernateMetrics and bind to the specified meter registry.
        Parameters:
        registry - meter registry to use
        sessionFactory - session factory to use
        sessionFactoryName - session factory name as a tag value
        tags - additional tags
      • monitor

        public static void monitor​(io.micrometer.core.instrument.MeterRegistry registry,
                                   SessionFactory sessionFactory,
                                   String sessionFactoryName,
                                   Iterable<io.micrometer.core.instrument.Tag> tags)
        Create HibernateMetrics and bind to the specified meter registry.
        Parameters:
        registry - meter registry to use
        sessionFactory - session factory to use
        sessionFactoryName - session factory name as a tag value
        tags - additional tags
      • bindTo

        public void bindTo​(io.micrometer.core.instrument.MeterRegistry registry)
        Specified by:
        bindTo in interface io.micrometer.core.instrument.binder.MeterBinder