use of org.apache.ignite.spi.tracing.TracingConfigurationParameters.SAMPLING_RATE_NEVER in project ignite by apache.
the class OpenCensusTxTracingConfigurationTest method testTxConfigurationSamplingRateNeverPreventsTxTracing.
/**
* Ensure that in case of sampling rate equals to 0.0 (Never) no transactions are traced.
*
* @throws Exception If Failed.
*/
@Test
public void testTxConfigurationSamplingRateNeverPreventsTxTracing() throws Exception {
IgniteEx client = startGrid("client");
client.tracingConfiguration().set(new TracingConfigurationCoordinates.Builder(TX).build(), new TracingConfigurationParameters.Builder().withSamplingRate(SAMPLING_RATE_NEVER).build());
client.transactions().txStart(PESSIMISTIC, SERIALIZABLE).commit();
handler().flush();
Set<String> unexpectedTxSpanNames = Arrays.stream(SpanType.values()).filter(spanType -> spanType.scope() == TX).map(SpanType::spanName).collect(Collectors.toSet());
java.util.List<SpanData> gotSpans = handler().allSpans().filter(span -> unexpectedTxSpanNames.contains(span.getName())).collect(Collectors.toList());
assertTrue(gotSpans.isEmpty());
}
Aggregations