info("PLUGINSD: '%s' running on pid %d", cd->fullfilename, cd->pid);
RRDSET *st = NULL;
- char *s;
uint32_t hash;
while(likely(fgets(line, PLUGINSD_LINE_MAX, fp) != NULL)) {
// debug(D_PLUGINSD, "PLUGINSD: %s: %s", cd->filename, line);
int w = pluginsd_split_words(line, words, MAX_WORDS);
- s = words[0];
+ char *s = words[0];
if(unlikely(!s || !*s || !w)) {
// debug(D_PLUGINSD, "PLUGINSD: empty line");
continue;
unsigned long long microseconds = 0;
if(microseconds_txt && *microseconds_txt) microseconds = strtoull(microseconds_txt, NULL, 10);
if(microseconds) rrdset_next_usec(st, microseconds);
- else rrdset_next_plugins(st);
+ else rrdset_next(st);
}
}
else if(likely(hash == END_HASH && !strcmp(s, "END"))) {
}
else {
// second+ run
- usec = usec_dt(&now, &last) - susec;
+ usec = dt_usec(&now, &last) - susec;
error("PLUGINSD: %s last loop took %llu usec (worked for %llu, sleeped for %llu).\n", cd->fullfilename, usec + susec, usec, susec);
if(unlikely(usec < (rrd_update_every * 1000000ULL / 2ULL))) susec = (rrd_update_every * 1000000ULL) - usec;
else susec = rrd_update_every * 1000000ULL / 2ULL;
cd->enabled = enabled;
cd->update_every = (int) config_get_number(cd->id, "update every", rrd_update_every);
- cd->started_t = time(NULL);
+ cd->started_t = now_realtime_sec();
char *def = "";
snprintfz(cd->cmd, PLUGINSD_CMD_MAX, "exec %s %d %s", cd->fullfilename, cd->update_every, config_get(cd->id, "command options", def));