use of com.redhat.service.smartevents.manager.models.Processor in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class MetricsServiceImplTest method onOperationStart_forProcessor.
@ParameterizedTest
@EnumSource(MetricsOperation.class)
public void onOperationStart_forProcessor(MetricsOperation metricsOperation) {
Bridge bridge = Fixtures.createBridge();
ManagedResourceStatus status = metricsOperation == MetricsOperation.DELETE ? ManagedResourceStatus.DEPROVISION : ManagedResourceStatus.ACCEPTED;
Processor processor = Fixtures.createProcessor(bridge, status);
metricsService.onOperationStart(processor, metricsOperation);
List<Tag> expectedTags = createdExpectedTags(processor, metricsOperation);
assertThat(meterRegistry.counter(operationTotalCountMetricName, expectedTags).count()).isEqualTo(1.0);
}
use of com.redhat.service.smartevents.manager.models.Processor in project sandbox by 5733d9e2be6485d52ffa08870cabdee0.
the class MetricsServiceImplTest method onOperationComplete_forFailedProcessor.
@Test
public void onOperationComplete_forFailedProcessor() {
Bridge bridge = Fixtures.createBridge();
Processor processor = Fixtures.createProcessor(bridge, ManagedResourceStatus.FAILED);
metricsService.onOperationComplete(processor, MetricsOperation.PROVISION);
List<Tag> expectedTags = createdExpectedTags(processor, MetricsOperation.PROVISION);
assertThat(meterRegistry.counter(operationTotalSuccessCountMetricName, expectedTags).count()).isEqualTo(0.0);
assertThat(meterRegistry.timer(operatonDurationMetricName, expectedTags).totalTime(TimeUnit.MINUTES)).isEqualTo(0.0);
}
Aggregations