Search in sources :

Example 1 with MonitoringConfiguration

use of com.sequenceiq.cloudbreak.telemetry.monitoring.MonitoringConfiguration in project cloudbreak by hortonworks.

the class TelemetryConverterTest method setUp.

@Before
public void setUp() {
    AltusDatabusConfiguration altusDatabusConfiguration = new AltusDatabusConfiguration(DATABUS_ENDPOINT, DATABUS_S3_BUCKET, true, "****", "****");
    MeteringConfiguration meteringConfiguration = new MeteringConfiguration(true, "app", "stream");
    ClusterLogsCollectionConfiguration logCollectionConfig = new ClusterLogsCollectionConfiguration(true, "app", "stream");
    MonitoringConfiguration monitoringConfig = new MonitoringConfiguration();
    monitoringConfig.setEnabled(true);
    TelemetryConfiguration telemetryConfiguration = new TelemetryConfiguration(altusDatabusConfiguration, meteringConfiguration, logCollectionConfig, monitoringConfig, null);
    underTest = new TelemetryConverter(telemetryConfiguration, true, true);
}
Also used : MeteringConfiguration(com.sequenceiq.cloudbreak.telemetry.metering.MeteringConfiguration) TelemetryConfiguration(com.sequenceiq.cloudbreak.telemetry.TelemetryConfiguration) AltusDatabusConfiguration(com.sequenceiq.cloudbreak.altus.AltusDatabusConfiguration) MonitoringConfiguration(com.sequenceiq.cloudbreak.telemetry.monitoring.MonitoringConfiguration) ClusterLogsCollectionConfiguration(com.sequenceiq.cloudbreak.telemetry.logcollection.ClusterLogsCollectionConfiguration) Before(org.junit.Before)

Example 2 with MonitoringConfiguration

use of com.sequenceiq.cloudbreak.telemetry.monitoring.MonitoringConfiguration in project cloudbreak by hortonworks.

the class TelemetryConverterTest method testConvertFromEnvAndSdxResponseWithDefaultDisabled.

@Test
public void testConvertFromEnvAndSdxResponseWithDefaultDisabled() {
    // GIVEN
    SdxClusterResponse sdxClusterResponse = null;
    AltusDatabusConfiguration altusDatabusConfiguration = new AltusDatabusConfiguration(DATABUS_ENDPOINT, DATABUS_S3_BUCKET, false, "", null);
    MeteringConfiguration meteringConfiguration = new MeteringConfiguration(true, null, null);
    ClusterLogsCollectionConfiguration logCollectionConfig = new ClusterLogsCollectionConfiguration(true, null, null);
    MonitoringConfiguration monitoringConfig = new MonitoringConfiguration();
    monitoringConfig.setEnabled(true);
    TelemetryConfiguration telemetryConfiguration = new TelemetryConfiguration(altusDatabusConfiguration, meteringConfiguration, logCollectionConfig, monitoringConfig, null);
    TelemetryConverter converter = new TelemetryConverter(telemetryConfiguration, true, false);
    // WHEN
    TelemetryRequest result = converter.convert(null, sdxClusterResponse);
    // THEN
    assertNull(result.getWorkloadAnalytics());
    assertNull(result.getFeatures().getMonitoring());
    assertNotNull(result.getFeatures());
    assertFalse(result.getFeatures().getWorkloadAnalytics().isEnabled());
}
Also used : MeteringConfiguration(com.sequenceiq.cloudbreak.telemetry.metering.MeteringConfiguration) TelemetryConfiguration(com.sequenceiq.cloudbreak.telemetry.TelemetryConfiguration) TelemetryRequest(com.sequenceiq.common.api.telemetry.request.TelemetryRequest) AltusDatabusConfiguration(com.sequenceiq.cloudbreak.altus.AltusDatabusConfiguration) MonitoringConfiguration(com.sequenceiq.cloudbreak.telemetry.monitoring.MonitoringConfiguration) SdxClusterResponse(com.sequenceiq.sdx.api.model.SdxClusterResponse) ClusterLogsCollectionConfiguration(com.sequenceiq.cloudbreak.telemetry.logcollection.ClusterLogsCollectionConfiguration) Test(org.junit.Test)

Example 3 with MonitoringConfiguration

use of com.sequenceiq.cloudbreak.telemetry.monitoring.MonitoringConfiguration in project cloudbreak by hortonworks.

the class TelemetryApiConverterTest method setUp.

@BeforeEach
public void setUp() {
    MockitoAnnotations.openMocks(this);
    AltusDatabusConfiguration altusDatabusConfiguration = new AltusDatabusConfiguration("", "", true, "****", "****");
    MeteringConfiguration meteringConfiguration = new MeteringConfiguration(false, null, null);
    ClusterLogsCollectionConfiguration logCollectionConfig = new ClusterLogsCollectionConfiguration(true, null, null);
    MonitoringConfiguration monitoringConfig = new MonitoringConfiguration();
    monitoringConfig.setEnabled(true);
    monitoringConfig.setRemoteWriteUrl("http://myaddress/api/v1/receive");
    TelemetryConfiguration telemetryConfiguration = new TelemetryConfiguration(altusDatabusConfiguration, meteringConfiguration, logCollectionConfig, monitoringConfig, null);
    underTest = new TelemetryApiConverter(telemetryConfiguration, entitlementService);
}
Also used : MeteringConfiguration(com.sequenceiq.cloudbreak.telemetry.metering.MeteringConfiguration) TelemetryConfiguration(com.sequenceiq.cloudbreak.telemetry.TelemetryConfiguration) AltusDatabusConfiguration(com.sequenceiq.cloudbreak.altus.AltusDatabusConfiguration) MonitoringConfiguration(com.sequenceiq.cloudbreak.telemetry.monitoring.MonitoringConfiguration) ClusterLogsCollectionConfiguration(com.sequenceiq.cloudbreak.telemetry.logcollection.ClusterLogsCollectionConfiguration) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 4 with MonitoringConfiguration

use of com.sequenceiq.cloudbreak.telemetry.monitoring.MonitoringConfiguration in project cloudbreak by hortonworks.

the class TelemetryConverterTest method setUp.

@BeforeEach
public void setUp() {
    AltusDatabusConfiguration altusDatabusConfiguration = new AltusDatabusConfiguration(DATABUS_ENDPOINT, DATABUS_S3_BUCKET, false, "", null);
    MeteringConfiguration meteringConfiguration = new MeteringConfiguration(false, null, null);
    ClusterLogsCollectionConfiguration logCollectionConfig = new ClusterLogsCollectionConfiguration(true, null, null);
    MonitoringConfiguration monitoringConfig = new MonitoringConfiguration();
    monitoringConfig.setEnabled(true);
    TelemetryConfiguration telemetryConfiguration = new TelemetryConfiguration(altusDatabusConfiguration, meteringConfiguration, logCollectionConfig, monitoringConfig, null);
    underTest = new TelemetryConverter(telemetryConfiguration, true);
}
Also used : MeteringConfiguration(com.sequenceiq.cloudbreak.telemetry.metering.MeteringConfiguration) TelemetryConfiguration(com.sequenceiq.cloudbreak.telemetry.TelemetryConfiguration) AltusDatabusConfiguration(com.sequenceiq.cloudbreak.altus.AltusDatabusConfiguration) MonitoringConfiguration(com.sequenceiq.cloudbreak.telemetry.monitoring.MonitoringConfiguration) ClusterLogsCollectionConfiguration(com.sequenceiq.cloudbreak.telemetry.logcollection.ClusterLogsCollectionConfiguration) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 5 with MonitoringConfiguration

use of com.sequenceiq.cloudbreak.telemetry.monitoring.MonitoringConfiguration in project cloudbreak by hortonworks.

the class TelemetryConverterTest method testConvertFromEnvAndSdxResponseWithWADisabledGlobally.

@Test
public void testConvertFromEnvAndSdxResponseWithWADisabledGlobally() {
    // GIVEN
    TelemetryResponse response = new TelemetryResponse();
    SdxClusterResponse sdxClusterResponse = new SdxClusterResponse();
    sdxClusterResponse.setCrn("crn:cdp:cloudbreak:us-west-1:someone:sdxcluster:sdxId");
    sdxClusterResponse.setName("sdxName");
    AltusDatabusConfiguration altusDatabusConfiguration = new AltusDatabusConfiguration(DATABUS_ENDPOINT, DATABUS_S3_BUCKET, false, "", null);
    MeteringConfiguration meteringConfiguration = new MeteringConfiguration(true, null, null);
    ClusterLogsCollectionConfiguration logCollectionConfig = new ClusterLogsCollectionConfiguration(true, null, null);
    MonitoringConfiguration monitoringConfig = new MonitoringConfiguration();
    monitoringConfig.setEnabled(true);
    TelemetryConfiguration telemetryConfiguration = new TelemetryConfiguration(altusDatabusConfiguration, meteringConfiguration, logCollectionConfig, monitoringConfig, null);
    TelemetryConverter converter = new TelemetryConverter(telemetryConfiguration, false, true);
    // WHEN
    TelemetryRequest result = converter.convert(response, sdxClusterResponse);
    // THEN
    assertNull(result.getWorkloadAnalytics());
}
Also used : TelemetryResponse(com.sequenceiq.common.api.telemetry.response.TelemetryResponse) MeteringConfiguration(com.sequenceiq.cloudbreak.telemetry.metering.MeteringConfiguration) TelemetryConfiguration(com.sequenceiq.cloudbreak.telemetry.TelemetryConfiguration) TelemetryRequest(com.sequenceiq.common.api.telemetry.request.TelemetryRequest) AltusDatabusConfiguration(com.sequenceiq.cloudbreak.altus.AltusDatabusConfiguration) MonitoringConfiguration(com.sequenceiq.cloudbreak.telemetry.monitoring.MonitoringConfiguration) SdxClusterResponse(com.sequenceiq.sdx.api.model.SdxClusterResponse) ClusterLogsCollectionConfiguration(com.sequenceiq.cloudbreak.telemetry.logcollection.ClusterLogsCollectionConfiguration) Test(org.junit.Test)

Aggregations

AltusDatabusConfiguration (com.sequenceiq.cloudbreak.altus.AltusDatabusConfiguration)5 TelemetryConfiguration (com.sequenceiq.cloudbreak.telemetry.TelemetryConfiguration)5 ClusterLogsCollectionConfiguration (com.sequenceiq.cloudbreak.telemetry.logcollection.ClusterLogsCollectionConfiguration)5 MeteringConfiguration (com.sequenceiq.cloudbreak.telemetry.metering.MeteringConfiguration)5 MonitoringConfiguration (com.sequenceiq.cloudbreak.telemetry.monitoring.MonitoringConfiguration)5 TelemetryRequest (com.sequenceiq.common.api.telemetry.request.TelemetryRequest)2 SdxClusterResponse (com.sequenceiq.sdx.api.model.SdxClusterResponse)2 Test (org.junit.Test)2 BeforeEach (org.junit.jupiter.api.BeforeEach)2 TelemetryResponse (com.sequenceiq.common.api.telemetry.response.TelemetryResponse)1 Before (org.junit.Before)1