Class OciMetricsSupport.Builder
- java.lang.Object
-
- io.helidon.integrations.oci.metrics.OciMetricsSupport.Builder
-
- All Implemented Interfaces:
Builder<OciMetricsSupport>
,Supplier<OciMetricsSupport>
- Enclosing class:
- OciMetricsSupport
public static class OciMetricsSupport.Builder extends Object implements Builder<OciMetricsSupport>
Fluent API builder to createOciMetricsSupport
.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OciMetricsSupport.Builder
batchDelay(long value)
Sets the delay interval if metrics are posted in batches (defaults to 1L).OciMetricsSupport.Builder
batchSize(int value)
Sets the maximum no.OciMetricsSupport
build()
Build the instance from this builder.OciMetricsSupport.Builder
compartmentId(String value)
Sets the compartment ID.OciMetricsSupport.Builder
config(Config config)
Updates the builder using the specified OCI metricsConfig
node.OciMetricsSupport.Builder
delay(long value)
Sets the delay interval between metric posting (defaults to 60L).OciMetricsSupport.Builder
descriptionEnabled(boolean value)
Sets whether the description should be enabled or not.boolean
enabled()
Returns boolean value to indicate whether OciMetricsSupport service will be activated or not.OciMetricsSupport.Builder
enabled(boolean value)
Sets whether metrics transmission to OCI is enabled.OciMetricsSupport.Builder
initialDelay(long value)
Sets the initial delay before metrics are sent to OCI (defaults to 1L).OciMetricsSupport.Builder
monitoringClient(Monitoring monitoringClient)
Sets theMonitoring
client instance to use in sending metrics to OCI.OciMetricsSupport.Builder
nameFormatter(OciMetricsSupport.NameFormatter nameFormatter)
Sets theOciMetricsSupport.NameFormatter
to use in formatting metric names.OciMetricsSupport.Builder
namespace(String value)
Sets the namespace.OciMetricsSupport.Builder
resourceGroup(String value)
Sets the resource group.OciMetricsSupport.Builder
schedulingTimeUnit(TimeUnit timeUnit)
Sets the time unit applied to the initial delay and delay values (defaults toTimeUnit.SECONDS
).OciMetricsSupport.Builder
scopes(String[] value)
Sets which metrics scopes (e.g., base, vendor, application) should be sent to OCI.
-
-
-
Method Detail
-
build
public OciMetricsSupport build()
Description copied from interface:Builder
Build the instance from this builder.- Specified by:
build
in interfaceBuilder<OciMetricsSupport>
- Returns:
- instance of the built type
-
initialDelay
public OciMetricsSupport.Builder initialDelay(long value)
Sets the initial delay before metrics are sent to OCI (defaults to 1L).- Parameters:
value
- initial delay, expressed in time units set byschedulingTimeUnit(TimeUnit)
- Returns:
- updated builder
-
delay
public OciMetricsSupport.Builder delay(long value)
Sets the delay interval between metric posting (defaults to 60L).- Parameters:
value
- delay, expressed in time units set byschedulingTimeUnit(TimeUnit)
- Returns:
- updated builder
-
batchDelay
public OciMetricsSupport.Builder batchDelay(long value)
Sets the delay interval if metrics are posted in batches (defaults to 1L).- Parameters:
value
- batch delay, expressed in time units set byschedulingTimeUnit(TimeUnit)
- Returns:
- updated builder
-
schedulingTimeUnit
public OciMetricsSupport.Builder schedulingTimeUnit(TimeUnit timeUnit)
Sets the time unit applied to the initial delay and delay values (defaults toTimeUnit.SECONDS
).- Parameters:
timeUnit
- unit of time- Returns:
- updated builder
-
compartmentId
public OciMetricsSupport.Builder compartmentId(String value)
Sets the compartment ID.- Parameters:
value
- compartment ID- Returns:
- updated builder
-
namespace
public OciMetricsSupport.Builder namespace(String value)
Sets the namespace.- Parameters:
value
- namespace- Returns:
- updated builder
-
nameFormatter
public OciMetricsSupport.Builder nameFormatter(OciMetricsSupport.NameFormatter nameFormatter)
Sets theOciMetricsSupport.NameFormatter
to use in formatting metric names. See theOciMetricsSupport.NameFormatter.format( MetricID, String, Metadata)
method for details about the default formatting.- Parameters:
nameFormatter
- the formatter to use- Returns:
- updated builder
-
resourceGroup
public OciMetricsSupport.Builder resourceGroup(String value)
Sets the resource group.- Parameters:
value
- resource group- Returns:
- updated builder
-
descriptionEnabled
public OciMetricsSupport.Builder descriptionEnabled(boolean value)
Sets whether the description should be enabled or not.Defaults to
true
.- Parameters:
value
- enabled- Returns:
- updated builder
-
scopes
public OciMetricsSupport.Builder scopes(String[] value)
Sets which metrics scopes (e.g., base, vendor, application) should be sent to OCI.If this method is never invoked, defaults to all scopes.
- Parameters:
value
- array of metric scopes to process- Returns:
- updated builder
-
enabled
public OciMetricsSupport.Builder enabled(boolean value)
Sets whether metrics transmission to OCI is enabled.Defaults to
true
.- Parameters:
value
- whether metrics transmission should be enabled- Returns:
- updated builder
-
batchSize
public OciMetricsSupport.Builder batchSize(int value)
Sets the maximum no. of metrics to send in a batch (defaults to 50).- Parameters:
value
- maximum no. of metrics to send in a batch- Returns:
- updated builder
-
config
public OciMetricsSupport.Builder config(Config config)
Updates the builder using the specified OCI metricsConfig
node.- Parameters:
config
-Config
node containing the OCI metrics settings- Returns:
- updated builder
-
monitoringClient
public OciMetricsSupport.Builder monitoringClient(Monitoring monitoringClient)
Sets theMonitoring
client instance to use in sending metrics to OCI.- Parameters:
monitoringClient
- theMonitoringClient
instance- Returns:
- updated builder
-
enabled
public boolean enabled()
Returns boolean value to indicate whether OciMetricsSupport service will be activated or not.- Returns:
true
if OciMetricsSupport service will be activated orfalse
if it not
-
-