Module io.helidon.dbclient.metrics
Package io.helidon.dbclient.metrics
Class DbClientMetricBuilder<B extends DbClientMetricBuilder<B,T>,T extends DbClientServiceBase>
java.lang.Object
io.helidon.dbclient.DbClientServiceBase.BuilderBase<B,T>
io.helidon.dbclient.metrics.DbClientMetricBuilder<B,T>
- Type Parameters:
B
- type of the builder extending this classT
- Type of the builtDbClientServiceBase
instance
public abstract class DbClientMetricBuilder<B extends DbClientMetricBuilder<B,T>,T extends DbClientServiceBase>
extends DbClientServiceBase.BuilderBase<B,T>
Database Client metric builder.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionConfigure a metric from configuration.description
(String description) Description of the metric used in metric metadata.errors
(boolean measureErrors) Whether to measure failed statements.metadata
(io.helidon.dbclient.metrics.MeterMetadata meta) Configure metric metadata.Configure a metric name.nameFormat
(String format) Configure a name format.nameFormat
(BiFunction<String, DbStatementType, String> function) Configure a name format function.success
(boolean measureSuccess) Whether to measure successful statements.Methods inherited from class io.helidon.dbclient.DbClientServiceBase.BuilderBase
enabled, predicate, statementNames, statementNames, statementNames, statementPredicate, statementTypes, statementTypes, statementTypes
-
Constructor Details
-
DbClientMetricBuilder
public DbClientMetricBuilder()
-
-
Method Details
-
name
Configure a metric name.- Parameters:
metricName
- name of the metric- Returns:
- updated builder instance
-
metadata
Configure metric metadata.- Parameters:
meta
- metric metadata- Returns:
- updated builder instance
-
nameFormat
Configure a name format.The format can use up to two parameters - first is the
DbStatementType
as a string, second is the statement name.- Parameters:
format
- format string expecting zero to two parameters that can be processed byString.format(String, Object...)
- Returns:
- updated builder instance
-
nameFormat
Configure a name format function.The first parameter is the statement name.
- Parameters:
function
- function to use to create metric name- Returns:
- updated builder instance
-
errors
Whether to measure failed statements.- Parameters:
measureErrors
- set tofalse
if errors should be ignored- Returns:
- updated builder instance
-
success
Whether to measure successful statements.- Parameters:
measureSuccess
- set tofalse
if successes should be ignored- Returns:
- updated builder instance
-
description
Description of the metric used in metric metadata.- Parameters:
description
- description- Returns:
- updated builder instance
-
config
Configure a metric from configuration. The following configuration key are used:DB Metric configuration options key default description errors true
Whether this metric triggers for error states success true
Whether this metric triggers for successful executions name-format db.metric-type.statement-name
A string format used to construct a metric name. The format gets two parameters: the statement name and the statement type description Description of this metric. - Overrides:
config
in classDbClientServiceBase.BuilderBase<B extends io.helidon.dbclient.metrics.MetricBuilderBase<B,
T>, T extends DbClientServiceBase> - Parameters:
config
- configuration to configure this metric- Returns:
- updated builder instance
-