}
void *backends_main(void *ptr) {
- (void)ptr;
+ struct netdata_static_thread *static_thread = (struct netdata_static_thread *)ptr;
BUFFER *b = buffer_create(1), *response = buffer_create(1);
int (*backend_request_formatter)(BUFFER *b, const char *prefix, RRDHOST *host, const char *hostname, RRDSET *st, RRDDIM *rd, time_t after, time_t before, uint32_t options) = NULL;
if(!enabled || frequency < 1)
goto cleanup;
- if(!strcmp(source, "as collected")) {
+ if(!strsame(source, "as collected")) {
options = BACKEND_SOURCE_DATA_AS_COLLECTED;
}
- else if(!strcmp(source, "average")) {
+ else if(!strsame(source, "average")) {
options = BACKEND_SOURCE_DATA_AVERAGE;
}
- else if(!strcmp(source, "sum") || !strcmp(source, "volume")) {
+ else if(!strsame(source, "sum") || !strsame(source, "volume")) {
options = BACKEND_SOURCE_DATA_SUM;
}
else {
goto cleanup;
}
- if(!strcmp(type, "graphite") || !strcmp(type, "graphite:plaintext")) {
+ if(!strsame(type, "graphite") || !strsame(type, "graphite:plaintext")) {
default_port = 2003;
if(options == BACKEND_SOURCE_DATA_AS_COLLECTED)
backend_request_formatter = format_dimension_collected_graphite_plaintext;
backend_response_checker = process_graphite_response;
}
- else if(!strcmp(type, "opentsdb") || !strcmp(type, "opentsdb:telnet")) {
+ else if(!strsame(type, "opentsdb") || !strsame(type, "opentsdb:telnet")) {
default_port = 4242;
if(options == BACKEND_SOURCE_DATA_AS_COLLECTED)
backend_request_formatter = format_dimension_collected_opentsdb_telnet;
info("BACKEND thread exiting");
+ static_thread->enabled = 0;
pthread_exit(NULL);
return NULL;
}