Search in sources :

Example 6 with VisorTracingConfigurationTaskResult

use of org.apache.ignite.internal.visor.tracing.configuration.VisorTracingConfigurationTaskResult in project ignite by apache.

the class GridCommandHandlerTracingConfigurationTest method testSetWithScopeSetsScopeSpecificConfiguratoinAndReturnesScopeBasedConfiguration.

/**
 * Ensure that in case of "--tracing-configuration set --scope TX --sampling-rate 0.123
 * --included-scopes COMMUNICATION,EXCHANGE"
 * TX scope specific configuration should be updated.
 * Whole TX based configuration should be returned.
 */
@Test
public void testSetWithScopeSetsScopeSpecificConfiguratoinAndReturnesScopeBasedConfiguration() {
    assertEquals(EXIT_CODE_OK, execute(hnd, "--tracing-configuration", "set", "--scope", "TX", "--sampling-rate", "0.123", "--included-scopes", "COMMUNICATION,EXCHANGE"));
    // Check command result.
    VisorTracingConfigurationTaskResult expRes = new VisorTracingConfigurationTaskResult();
    expRes.add(TX_SCOPE_SPECIFIC_COORDINATES, new TracingConfigurationParameters.Builder().withSamplingRate(0.123).withIncludedScopes(new HashSet<>(Arrays.asList(COMMUNICATION, EXCHANGE))).build());
    expRes.add(TX_LABEL_SPECIFIC_COORDINATES, SOME_LABEL_SPECIFIC_PARAMETERS);
    verifyResult(expRes);
}
Also used : VisorTracingConfigurationTaskResult(org.apache.ignite.internal.visor.tracing.configuration.VisorTracingConfigurationTaskResult) Test(org.junit.Test)

Example 7 with VisorTracingConfigurationTaskResult

use of org.apache.ignite.internal.visor.tracing.configuration.VisorTracingConfigurationTaskResult in project ignite by apache.

the class GridCommandHandlerTracingConfigurationTest method testResetAllWithScopeResetsScopeBasedConfigurationAndReturnsIt.

/**
 * Ensure that in case of "--tracing-configuration reset_all --scope TX"
 * TX based configuration will be reseted and returned:
 */
@Test
public void testResetAllWithScopeResetsScopeBasedConfigurationAndReturnsIt() {
    assertEquals(EXIT_CODE_OK, execute(hnd, "--tracing-configuration", "reset_all", "--scope", "TX"));
    // Ensure that configuration was actually reseted.
    assertEquals(Collections.singletonMap(TX_SCOPE_SPECIFIC_COORDINATES, TracingConfigurationManager.DEFAULT_TX_CONFIGURATION), grid(0).tracingConfiguration().getAll(TX));
    // Check command result.
    VisorTracingConfigurationTaskResult expRes = new VisorTracingConfigurationTaskResult();
    expRes.add(TX_SCOPE_SPECIFIC_COORDINATES, TracingConfigurationManager.DEFAULT_TX_CONFIGURATION);
    verifyResult(expRes);
}
Also used : VisorTracingConfigurationTaskResult(org.apache.ignite.internal.visor.tracing.configuration.VisorTracingConfigurationTaskResult) Test(org.junit.Test)

Example 8 with VisorTracingConfigurationTaskResult

use of org.apache.ignite.internal.visor.tracing.configuration.VisorTracingConfigurationTaskResult in project ignite by apache.

the class GridCommandHandlerTracingConfigurationTest method testResetWithScopeAndLabelResetsLabelSpecificConfiguratoinAndReturnesScopeBasedConfiguration.

/**
 * Ensure that in case of "--tracing-configuration reset --scope TX --label label"
 * TX label specific configuration will be removed, TX scope specific configuration should stay unchanged.
 * Whole TX based configuration should be returned.
 */
@Test
public void testResetWithScopeAndLabelResetsLabelSpecificConfiguratoinAndReturnesScopeBasedConfiguration() {
    assertEquals(EXIT_CODE_OK, execute(hnd, "--tracing-configuration", "reset", "--scope", "TX", "--label", "label"));
    // Check command result.
    VisorTracingConfigurationTaskResult expRes = new VisorTracingConfigurationTaskResult();
    expRes.add(TX_SCOPE_SPECIFIC_COORDINATES, SOME_SCOPE_SPECIFIC_PARAMETERS);
    verifyResult(expRes);
}
Also used : VisorTracingConfigurationTaskResult(org.apache.ignite.internal.visor.tracing.configuration.VisorTracingConfigurationTaskResult) Test(org.junit.Test)

Example 9 with VisorTracingConfigurationTaskResult

use of org.apache.ignite.internal.visor.tracing.configuration.VisorTracingConfigurationTaskResult in project ignite by apache.

the class GridCommandHandlerTracingConfigurationTest method testGetAllWithoutScopeReturnsTracingConfigurationsForAllScopes.

/**
 * Ensure that in case of "--tracing-configuration get_all" without scope
 * tracing configuration for all scopes will be returned.
 */
@Test
public void testGetAllWithoutScopeReturnsTracingConfigurationsForAllScopes() {
    assertEquals(EXIT_CODE_OK, execute(hnd, "--tracing-configuration", "get_all"));
    // Check command result.
    Map<TracingConfigurationCoordinates, TracingConfigurationParameters> expTracingCfg = new HashMap<>(DFLT_CONFIG_MAP);
    expTracingCfg.put(TX_SCOPE_SPECIFIC_COORDINATES, SOME_SCOPE_SPECIFIC_PARAMETERS);
    expTracingCfg.put(TX_LABEL_SPECIFIC_COORDINATES, SOME_LABEL_SPECIFIC_PARAMETERS);
    expTracingCfg.put(EXCHANGE_SCOPE_SPECIFIC_COORDINATES, SOME_SCOPE_SPECIFIC_PARAMETERS);
    VisorTracingConfigurationTaskResult expRes = new VisorTracingConfigurationTaskResult();
    expTracingCfg.forEach(expRes::add);
    verifyResult(expRes);
}
Also used : TracingConfigurationParameters(org.apache.ignite.spi.tracing.TracingConfigurationParameters) HashMap(java.util.HashMap) TracingConfigurationCoordinates(org.apache.ignite.spi.tracing.TracingConfigurationCoordinates) VisorTracingConfigurationTaskResult(org.apache.ignite.internal.visor.tracing.configuration.VisorTracingConfigurationTaskResult) Test(org.junit.Test)

Example 10 with VisorTracingConfigurationTaskResult

use of org.apache.ignite.internal.visor.tracing.configuration.VisorTracingConfigurationTaskResult in project ignite by apache.

the class GridCommandHandlerTracingConfigurationTest method testTracingConfigurationWithoutSubCommandsReturnsTracingConfiguratoinForAllScopes.

/**
 * Ensure that in case of "--tracing-configuration" without arguments
 * tracing configuration for all scopes will be returned.
 */
@Test
public void testTracingConfigurationWithoutSubCommandsReturnsTracingConfiguratoinForAllScopes() {
    assertEquals(EXIT_CODE_OK, execute(hnd, "--tracing-configuration"));
    Map<TracingConfigurationCoordinates, TracingConfigurationParameters> expTracingCfg = new HashMap<>(DFLT_CONFIG_MAP);
    expTracingCfg.put(TX_SCOPE_SPECIFIC_COORDINATES, SOME_SCOPE_SPECIFIC_PARAMETERS);
    expTracingCfg.put(TX_LABEL_SPECIFIC_COORDINATES, SOME_LABEL_SPECIFIC_PARAMETERS);
    expTracingCfg.put(EXCHANGE_SCOPE_SPECIFIC_COORDINATES, SOME_SCOPE_SPECIFIC_PARAMETERS);
    VisorTracingConfigurationTaskResult expRes = new VisorTracingConfigurationTaskResult();
    expTracingCfg.forEach(expRes::add);
    verifyResult(expRes);
}
Also used : TracingConfigurationParameters(org.apache.ignite.spi.tracing.TracingConfigurationParameters) HashMap(java.util.HashMap) TracingConfigurationCoordinates(org.apache.ignite.spi.tracing.TracingConfigurationCoordinates) VisorTracingConfigurationTaskResult(org.apache.ignite.internal.visor.tracing.configuration.VisorTracingConfigurationTaskResult) Test(org.junit.Test)

Aggregations

VisorTracingConfigurationTaskResult (org.apache.ignite.internal.visor.tracing.configuration.VisorTracingConfigurationTaskResult)13 Test (org.junit.Test)11 HashMap (java.util.HashMap)3 TracingConfigurationCoordinates (org.apache.ignite.spi.tracing.TracingConfigurationCoordinates)3 TracingConfigurationParameters (org.apache.ignite.spi.tracing.TracingConfigurationParameters)3 UUID (java.util.UUID)1 GridClient (org.apache.ignite.internal.client.GridClient)1 VisorTracingConfigurationTask (org.apache.ignite.internal.visor.tracing.configuration.VisorTracingConfigurationTask)1