Package com.azure.core.util
Class MetricsOptions
java.lang.Object
com.azure.core.util.MetricsOptions
Metrics configuration options for clients.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MetricsOptionsfromConfiguration(Configuration configuration) Attempts to load metrics options from the configuration.booleanFlag indicating if metrics should be enabled.setEnabled(boolean enabled) Enables or disables metrics.
-
Constructor Details
-
MetricsOptions
public MetricsOptions()Creates new instance ofMetricsOptions
-
-
Method Details
-
fromConfiguration
Attempts to load metrics options from the configuration.nullwill be returned if no metric options are found in the environment.- Parameters:
configuration- TheConfigurationthat is used to load proxy configurations from the environment. Ifnullis passed thenConfiguration.getGlobalConfiguration()will be used.- Returns:
- A
MetricsOptionsreflecting a metrics loaded from configuration, if no options are found, default (enabled) options will be returned.
-
isEnabled
public boolean isEnabled()Flag indicating if metrics should be enabled.- Returns:
trueif metrics are enabled,falseotherwise.
-
setEnabled
Enables or disables metrics. By default, metrics are enabled if and only if metrics implementation is detected.- Parameters:
enabled- passtrueto enable metrics.- Returns:
- the updated
MetricsOptionsobject.
-