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);
}
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);
}
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);
}
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);
}
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);
}
Aggregations