use of io.jaegertracing.internal.exceptions.SamplingStrategyErrorException in project jaeger-client-java by jaegertracing.
the class RemoteControlledSampler method updateSampler.
/**
* Updates {@link #sampler} to a new sampler when it is different.
*/
void updateSampler() {
// visible for testing
SamplingStrategyResponse response;
try {
response = manager.getSamplingStrategy(serviceName);
metrics.samplerRetrieved.inc(1);
} catch (SamplingStrategyErrorException e) {
metrics.samplerQueryFailure.inc(1);
return;
}
if (response.getOperationSampling() != null) {
updatePerOperationSampler(response.getOperationSampling());
} else {
updateRateLimitingOrProbabilisticSampler(response);
}
}
use of io.jaegertracing.internal.exceptions.SamplingStrategyErrorException in project jaeger-client-java by jaegertracing.
the class RemoteControlledSamplerTest method testUnparseableResponse.
@Test
public void testUnparseableResponse() throws Exception {
when(samplingManager.getSamplingStrategy(SERVICE_NAME)).thenThrow(new SamplingStrategyErrorException("test"));
undertest.updateSampler();
assertEquals(initialSampler, undertest.getSampler());
}
Aggregations