Class DbTimer

    • Method Detail

      • create

        public static DbTimer create()
        Create a new timer using default configuration.

        By default the name format is db.timer.statement-name, where statement-name is provided at runtime.

        Returns:
        a new timer
      • builder

        public static DbTimer.Builder builder()
        Create a new fluent API builder to create a new timer metric.
        Returns:
        a new builder instance
      • executeMetric

        protected void executeMetric​(org.eclipse.microprofile.metrics.Timer metric,
                                     CompletionStage<Void> aFuture)
      • defaultNamePrefix

        protected String defaultNamePrefix()
      • metricType

        protected org.eclipse.microprofile.metrics.MetricType metricType()
      • metric

        protected org.eclipse.microprofile.metrics.Timer metric​(org.eclipse.microprofile.metrics.MetricRegistry registry,
                                                                org.eclipse.microprofile.metrics.Metadata meta)
      • statement

        public CompletableFuture<DbInterceptorContext> statement​(DbInterceptorContext interceptorContext)
        Description copied from interface: DbInterceptor
        Statement execution to be intercepted. This method is called before the statement execution starts.
        Specified by:
        statement in interface DbInterceptor
        Parameters:
        interceptorContext - Context to access data needed to process an interceptor
        Returns:
        completion stage that completes when this interceptor is finished
      • measureErrors

        protected boolean measureErrors()
      • measureSuccess

        protected boolean measureSuccess()