- java.lang.Object
-
- io.helidon.dbclient.metrics.DbTimer
-
- All Implemented Interfaces:
DbInterceptor
public final class DbTimer extends Object
Timer metric for Helidon DB. This class implements theDbInterceptorand can be configured either through aDbClient.Builderor through configuration.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDbTimer.BuilderFluent API builder forDbTimer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DbTimer.Builderbuilder()Create a new fluent API builder to create a new timer metric.static DbTimercreate()Create a new timer using default configuration.static DbTimercreate(io.helidon.config.Config config)Create a timer from configuration.protected StringdefaultNamePrefix()protected voidexecuteMetric(org.eclipse.microprofile.metrics.Timer metric, CompletionStage<Void> aFuture)protected booleanmeasureErrors()protected booleanmeasureSuccess()protected org.eclipse.microprofile.metrics.Timermetric(org.eclipse.microprofile.metrics.MetricRegistry registry, org.eclipse.microprofile.metrics.Metadata meta)protected org.eclipse.microprofile.metrics.MetricTypemetricType()CompletableFuture<DbInterceptorContext>statement(DbInterceptorContext interceptorContext)
-
-
-
Method Detail
-
create
public static DbTimer create(io.helidon.config.Config config)
Create a timer from configuration.- Parameters:
config- configuration to read- Returns:
- a new timer
- See Also:
DbMetricBuilder.config(io.helidon.config.Config)
-
create
public static DbTimer create()
Create a new timer using default configuration.By default the name format is
db.timer.statement-name, wherestatement-nameis 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)
- Specified by:
statementin interfaceDbInterceptor
-
measureErrors
protected boolean measureErrors()
-
measureSuccess
protected boolean measureSuccess()
-
-