MetricsOptions Class
- java.
lang. Object - com.
azure. core. util. MetricsOptions
- com.
public class MetricsOptions
Metrics configuration options for clients.
Constructor Summary
Modifier | Constructor | Description |
---|---|---|
MetricsOptions() |
Creates new instance of MetricsOptions |
|
protected | MetricsOptions(Class<? extends MeterProvider> meterProvider) |
Creates new instance of MetricsOptions |
Method Summary
Modifier and Type | Method and Description |
---|---|
static
Metrics |
fromConfiguration(Configuration configuration)
Attempts to load metrics options from the configuration. |
Class<> |
getMeterProvider()
Gets configured MeterProvider implementation that should be used to construct an instance of Meter. |
boolean |
isEnabled()
Flag indicating if metrics should be enabled. |
Metrics |
setEnabled(boolean enabled)
Enables or disables metrics. |
Methods inherited from java.lang.Object
Constructor Details
MetricsOptions
public MetricsOptions()
Creates new instance of MetricsOptions
MetricsOptions
protected MetricsOptions(Class meterProvider)
Creates new instance of MetricsOptions
Parameters:
null
), then the first MeterProvider resolved by ServiceLoader will
be used to create an instance of Meter. If the value is set and doesn't match any
MeterProvider resolved by ServiceLoader an IllegalStateException will be thrown when
attempting to create an instance of Meter.
Method Details
fromConfiguration
public static MetricsOptions fromConfiguration(Configuration configuration)
Attempts to load metrics options from the configuration.
Parameters:
null
is passed then getGlobalConfiguration() will be used.
Returns:
getMeterProvider
isEnabled
public boolean isEnabled()
Flag indicating if metrics should be enabled.
Returns:
true
if metrics are enabled, false
otherwise.setEnabled
public MetricsOptions setEnabled(boolean enabled)
Enables or disables metrics. By default, metrics are enabled if and only if metrics implementation is detected.
Parameters:
true
to enable metrics.
Returns:
Applies to
Azure SDK for Java