use of tech.pegasys.teku.infrastructure.metrics.MetricsConfig in project teku by ConsenSys.
the class MetricsOptionsTest method metricsEnabled_shouldNotRequireAValue.
@Test
public void metricsEnabled_shouldNotRequireAValue() {
TekuConfiguration tekuConfiguration = getTekuConfigurationFromArguments("--metrics-enabled");
final MetricsConfig config = tekuConfiguration.metricsConfig();
assertThat(config.isMetricsEnabled()).isTrue();
assertThat(createConfigBuilder().metrics(b -> b.metricsEnabled(true)).build()).usingRecursiveComparison().isEqualTo(tekuConfiguration);
}
use of tech.pegasys.teku.infrastructure.metrics.MetricsConfig in project teku by ConsenSys.
the class MetricsOptionsTest method metricsCategories_shouldAcceptMultipleValues.
@Test
public void metricsCategories_shouldAcceptMultipleValues() {
TekuConfiguration tekuConfiguration = getTekuConfigurationFromArguments("--metrics-categories", "LIBP2P,NETWORK,EVENTBUS,PROCESS");
final MetricsConfig config = tekuConfiguration.metricsConfig();
assertThat(config.getMetricsCategories()).isEqualTo(Set.of(LIBP2P, NETWORK, EVENTBUS, PROCESS));
assertThat(createConfigBuilder().metrics(b -> b.metricsCategories(Set.of(LIBP2P, NETWORK, EVENTBUS, PROCESS))).build()).usingRecursiveComparison().withComparatorForFields(SET_COMPARATOR, SET_FIELDS).isEqualTo(tekuConfiguration);
}
use of tech.pegasys.teku.infrastructure.metrics.MetricsConfig in project teku by ConsenSys.
the class MetricsOptionsTest method metricsCategories_shouldNotBeCaseSensitive.
@Test
public void metricsCategories_shouldNotBeCaseSensitive() {
final MetricsConfig config = getTekuConfigurationFromArguments("--metrics-categories", "LibP2P,network,EventBUS,PROCESS").metricsConfig();
assertThat(config.getMetricsCategories()).isEqualTo(Set.of(LIBP2P, NETWORK, EVENTBUS, PROCESS));
}
use of tech.pegasys.teku.infrastructure.metrics.MetricsConfig in project teku by ConsenSys.
the class MetricsOptionsTest method metricsHostAllowlist_shouldNotRequireAValue.
@Test
public void metricsHostAllowlist_shouldNotRequireAValue() {
TekuConfiguration tekuConfiguration = getTekuConfigurationFromArguments("--metrics-host-allowlist");
final MetricsConfig config = tekuConfiguration.metricsConfig();
assertThat(config.getMetricsHostAllowlist()).isEmpty();
assertThat(createConfigBuilder().metrics(b -> b.metricsHostAllowlist(List.of())).build()).usingRecursiveComparison().isEqualTo(tekuConfiguration);
}
use of tech.pegasys.teku.infrastructure.metrics.MetricsConfig in project teku by ConsenSys.
the class MetricsOptionsTest method metricsCategories_shouldAcceptStandardMetricCategories.
@ParameterizedTest(name = "{0}")
@EnumSource(StandardMetricCategory.class)
public void metricsCategories_shouldAcceptStandardMetricCategories(MetricCategory category) {
TekuConfiguration tekuConfiguration = getTekuConfigurationFromArguments("--metrics-categories", category.toString());
final MetricsConfig config = tekuConfiguration.metricsConfig();
assertThat(config.getMetricsCategories()).isEqualTo(Set.of(category));
assertThat(createConfigBuilder().metrics(b -> b.metricsCategories(Set.of(category))).build()).usingRecursiveComparison().withComparatorForFields(SET_COMPARATOR, SET_FIELDS).isEqualTo(tekuConfiguration);
}
Aggregations