Search in sources :

Example 1 with MetricsCapabilityBuildItem

use of io.quarkus.deployment.metrics.MetricsCapabilityBuildItem in project jobrunr by jobrunr.

the class JobRunrExtensionProcessorTest method addMetricsDoesAddStorageProviderMetricsIfEnabledAndMicroMeterSupport.

@Test
void addMetricsDoesAddStorageProviderMetricsIfEnabledAndMicroMeterSupport() {
    final AdditionalBeanBuildItem metricsBeanBuildItem = jobRunrExtensionProcessor.addMetrics(Optional.of(new MetricsCapabilityBuildItem(toSupport -> toSupport.equals(MetricsFactory.MICROMETER))), jobRunrConfiguration);
    assertThat(metricsBeanBuildItem.getBeanClasses()).contains(JobRunrMetricsStarter.class.getName()).contains(JobRunrMetricsProducer.StorageProviderMetricsProducer.class.getName()).doesNotContain(JobRunrMetricsProducer.BackgroundJobServerMetricsProducer.class.getName());
}
Also used : AdditionalBeanBuildItem(io.quarkus.arc.deployment.AdditionalBeanBuildItem) JobRunrMetricsProducer(org.jobrunr.quarkus.autoconfigure.metrics.JobRunrMetricsProducer) MetricsCapabilityBuildItem(io.quarkus.deployment.metrics.MetricsCapabilityBuildItem) JobRunrMetricsStarter(org.jobrunr.quarkus.autoconfigure.metrics.JobRunrMetricsStarter) Test(org.junit.jupiter.api.Test)

Example 2 with MetricsCapabilityBuildItem

use of io.quarkus.deployment.metrics.MetricsCapabilityBuildItem in project jobrunr by jobrunr.

the class JobRunrExtensionProcessorTest method addMetricsDoesNotAddMetricsIfEnabledButNoMicroMeterSupport.

@Test
void addMetricsDoesNotAddMetricsIfEnabledButNoMicroMeterSupport() {
    final AdditionalBeanBuildItem metricsBeanBuildItem = jobRunrExtensionProcessor.addMetrics(Optional.of(new MetricsCapabilityBuildItem(toSupport -> false)), jobRunrConfiguration);
    assertThat(metricsBeanBuildItem).isNull();
}
Also used : AdditionalBeanBuildItem(io.quarkus.arc.deployment.AdditionalBeanBuildItem) MetricsCapabilityBuildItem(io.quarkus.deployment.metrics.MetricsCapabilityBuildItem) Test(org.junit.jupiter.api.Test)

Example 3 with MetricsCapabilityBuildItem

use of io.quarkus.deployment.metrics.MetricsCapabilityBuildItem in project jobrunr by jobrunr.

the class JobRunrExtensionProcessorTest method addMetricsDoesAddStorageProviderAndBackgroundJobServerMetricsIfEnabledAndMicroMeterSupport.

@Test
void addMetricsDoesAddStorageProviderAndBackgroundJobServerMetricsIfEnabledAndMicroMeterSupport() {
    backgroundJobServerConfiguration.enabled = true;
    final AdditionalBeanBuildItem metricsBeanBuildItem = jobRunrExtensionProcessor.addMetrics(Optional.of(new MetricsCapabilityBuildItem(toSupport -> toSupport.equals(MetricsFactory.MICROMETER))), jobRunrConfiguration);
    assertThat(metricsBeanBuildItem.getBeanClasses()).contains(JobRunrMetricsStarter.class.getName()).contains(JobRunrMetricsProducer.StorageProviderMetricsProducer.class.getName()).contains(JobRunrMetricsProducer.BackgroundJobServerMetricsProducer.class.getName());
}
Also used : AdditionalBeanBuildItem(io.quarkus.arc.deployment.AdditionalBeanBuildItem) JobRunrMetricsProducer(org.jobrunr.quarkus.autoconfigure.metrics.JobRunrMetricsProducer) MetricsCapabilityBuildItem(io.quarkus.deployment.metrics.MetricsCapabilityBuildItem) JobRunrMetricsStarter(org.jobrunr.quarkus.autoconfigure.metrics.JobRunrMetricsStarter) Test(org.junit.jupiter.api.Test)

Aggregations

AdditionalBeanBuildItem (io.quarkus.arc.deployment.AdditionalBeanBuildItem)3 MetricsCapabilityBuildItem (io.quarkus.deployment.metrics.MetricsCapabilityBuildItem)3 Test (org.junit.jupiter.api.Test)3 JobRunrMetricsProducer (org.jobrunr.quarkus.autoconfigure.metrics.JobRunrMetricsProducer)2 JobRunrMetricsStarter (org.jobrunr.quarkus.autoconfigure.metrics.JobRunrMetricsStarter)2