use of org.apache.ignite.spi.tracing.TracingConfigurationParameters 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.spi.tracing.TracingConfigurationParameters 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);
}
use of org.apache.ignite.spi.tracing.TracingConfigurationParameters in project ignite by apache.
the class GridTracingConfigurationManager method set.
/**
* {@inheritDoc}
*/
@Override
public void set(@NotNull TracingConfigurationCoordinates coordinates, @NotNull TracingConfigurationParameters parameters) {
HashMap<TracingConfigurationCoordinates, TracingConfigurationParameters> newTracingConfiguration = new HashMap<>(tracingConfiguration);
newTracingConfiguration.put(coordinates, parameters);
try {
distributedTracingConfiguration.propagate(newTracingConfiguration);
} catch (IgniteCheckedException e) {
String warningMsg = String.format(WARNING_MSG_TRACING_CONFIG_UPDATE_FAILED_COORDINATES, coordinates);
log.warning(warningMsg, e);
throw new IgniteException(warningMsg, e);
}
}
use of org.apache.ignite.spi.tracing.TracingConfigurationParameters in project ignite by apache.
the class OpenCensusTracingConfigurationGetTest method testThatScopeSpecificConfigurationGetReturnsScopeSpecificEventIfLabelSpecificIsSet.
/**
* Ensure that scope specific configuration get returns corresponding custom specific one if it's available
* and ignores label specific one.
*/
@Test
public void testThatScopeSpecificConfigurationGetReturnsScopeSpecificEventIfLabelSpecificIsSet() {
TracingConfigurationCoordinates scopeSpecificCoords = new TracingConfigurationCoordinates.Builder(TX).build();
TracingConfigurationCoordinates lbSpecificCoords = new TracingConfigurationCoordinates.Builder(TX).withLabel("label").build();
TracingConfigurationParameters expScopeSpecificParameters = new TracingConfigurationParameters.Builder().withSamplingRate(0.35).withIncludedScopes(Collections.singleton(COMMUNICATION)).build();
grid(0).tracingConfiguration().set(lbSpecificCoords, expScopeSpecificParameters);
assertEquals(TracingConfigurationManager.DEFAULT_TX_CONFIGURATION, grid(0).tracingConfiguration().get(scopeSpecificCoords));
}
use of org.apache.ignite.spi.tracing.TracingConfigurationParameters in project ignite by apache.
the class OpenCensusTracingConfigurationGetTest method testThatLabelSpecificConfigurationGetReturnsLabelSpecificOne.
/**
* Ensure that label specific configuration get returns custom label specific is such one is present.
*/
@Test
public void testThatLabelSpecificConfigurationGetReturnsLabelSpecificOne() {
TracingConfigurationCoordinates coords = new TracingConfigurationCoordinates.Builder(TX).withLabel("label").build();
TracingConfigurationParameters expScopeSpecificParameters = new TracingConfigurationParameters.Builder().withSamplingRate(0.35).withIncludedScopes(Collections.singleton(COMMUNICATION)).build();
grid(0).tracingConfiguration().set(coords, expScopeSpecificParameters);
assertEquals(expScopeSpecificParameters, grid(0).tracingConfiguration().get(coords));
}
Aggregations