- java.lang.Object
-
- io.helidon.dbclient.metrics.DbMeter
-
- All Implemented Interfaces:
DbInterceptor
public final class DbMeter extends Object
Meter 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 classDbMeter.BuilderFluent API builder forDbMeter.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DbMeter.Builderbuilder()Create a new fluent API builder to create a new meter metric.static DbMetercreate()Create a new meter using default configuration.static DbMetercreate(io.helidon.config.Config config)Create a meter from configuration.protected StringdefaultNamePrefix()protected voidexecuteMetric(org.eclipse.microprofile.metrics.Meter metric, CompletionStage<Void> aFuture)protected booleanmeasureErrors()protected booleanmeasureSuccess()protected org.eclipse.microprofile.metrics.Metermetric(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 DbMeter create(io.helidon.config.Config config)
Create a meter from configuration.- Parameters:
config- configuration to read- Returns:
- a new meter
- See Also:
DbMetricBuilder.config(io.helidon.config.Config)
-
create
public static DbMeter create()
Create a new meter using default configuration.By default the name format is
db.meter.statement-name, wherestatement-nameis provided at runtime.- Returns:
- a new meter
-
builder
public static DbMeter.Builder builder()
Create a new fluent API builder to create a new meter metric.- Returns:
- a new builder instance
-
executeMetric
protected void executeMetric(org.eclipse.microprofile.metrics.Meter metric, CompletionStage<Void> aFuture)
-
metricType
protected org.eclipse.microprofile.metrics.MetricType metricType()
-
metric
protected org.eclipse.microprofile.metrics.Meter metric(org.eclipse.microprofile.metrics.MetricRegistry registry, org.eclipse.microprofile.metrics.Metadata meta)
-
defaultNamePrefix
protected String defaultNamePrefix()
-
statement
public CompletableFuture<DbInterceptorContext> statement(DbInterceptorContext interceptorContext)
- Specified by:
statementin interfaceDbInterceptor
-
measureErrors
protected boolean measureErrors()
-
measureSuccess
protected boolean measureSuccess()
-
-