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 builtDbClientServiceBaseinstance
public abstract class DbClientMetricBuilder<B extends DbClientMetricBuilder<B,T>, T extends DbClientServiceBase>
extends DbClientServiceBase.BuilderBase<B,T>
Database Client metric builder.
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated, for removal: This API element is subject to removal in a future version. -
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 DbClientServiceBase.BuilderBase
enabled, predicate, statementNames, statementNames, statementNames, statementPredicate, statementTypes, statementTypes, statementTypesModifier and TypeMethodDescriptionvoidenabled(boolean enabled) Configure whether this service is enabled or not.protected Predicate<DbClientServiceContext> Predicate used to build a client service.Set of statement name patterns.statementNames(String... names) Configure statement name patterns this service will be triggered for.protected BstatementNames(List<String> names) Configures statement name patterns from configuration.statementPredicate(Predicate<DbClientServiceContext> predicate) Configure a predicate whose result will be used to decide whether to trigger this service or not.protected Set<DbStatementType> Set of statement types.statementTypes(DbStatementType... types) Configure statement types this service will be triggered for.protected BstatementTypes(List<DbStatementType> types) Configures statement types from configuration.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
DbClientMetricBuilder
Deprecated, for removal: This API element is subject to removal in a future version.direct public use is not supported; useDbClientMetrics.counter()orDbClientMetrics.timer()for the built-in metric buildersCreates a database client metric builder. Child classes may call this constructor; only direct public use is not supported.
-
-
Method Details
-
name
-
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
DbStatementTypeas 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 tofalseif errors should be ignored- Returns:
- updated builder instance
-
success
Whether to measure successful statements.- Parameters:
measureSuccess- set tofalseif successes should be ignored- Returns:
- updated builder instance
-
description
-
config
Configure a metric from configuration. The following configuration key are used:DB Metric configuration options key default description errors trueWhether this metric triggers for error states success trueWhether this metric triggers for successful executions name-format db.metric-type.statement-nameA 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:
configin 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
-
DbClientMetrics.counter()orDbClientMetrics.timer()for the built-in metric builders