protected void initialize() {
checkState(getConfig(URL) != null ^ getConfig(URL_SENSOR) != null,
"Must set exactly one of url or urlSensor: url=%s; urlSensor=%s", getConfig(URL), getConfig(URL_SENSOR));
checkState(getConfig(URL_SENSOR) != null || getConfig(URL_POST_PROCESSING) == null,
"Must not set urlPostProcessing without urlSensor");
Object configValue = getConfig(URL);
if (configValue != null) {
url.set(configValue.toString());
}
httpFeed = HttpFeed.builder()
.entity(entity)
.period(getConfig(PERIOD))
.baseUri(Suppliers.compose(Urls.stringToUriFunction(), AtomicReferences.supplier(url)))
.poll(new HttpPollConfig<Double>(REQUEST_LATENCY_IN_SECONDS_MOST_RECENT)
.onResult(MathFunctions.divide(HttpValueFunctions.latency(), 1000.0d))
.setOnException(null))
.suspended()
.build();
if (getUniqueTag()==null)
uniqueTag = JavaClassNames.simpleClassName(getClass())+":"+
(getConfig(URL)!=null ? getConfig(URL) : getConfig(URL_SENSOR));
}