uint32_t flags; // flags about this RRDHOST
int rrd_update_every; // the update frequency of the host
- int rrd_history_entries; // the number of history entries for the host's charts
+ long rrd_history_entries; // the number of history entries for the host's charts
RRD_MEMORY_MODE rrd_memory_mode; // the memory more for the charts of this host
char *cache_dir; // the directory to save RRD cache files
, const char *guid
, const char *os
, int update_every
- , int history
+ , long history
, RRD_MEMORY_MODE mode
, int health_enabled
, int rrdpush_enabled
buffer_sprintf(wb, "\n\t],\n"
"\t\"hostname\": \"%s\",\n"
"\t\"update_every\": %d,\n"
- "\t\"history\": %d,\n"
+ "\t\"history\": %ld,\n"
"\t\"memory\": %lu\n"
"}\n"
, host->hostname
const char *guid,
const char *os,
int update_every,
- int entries,
+ long entries,
RRD_MEMORY_MODE memory_mode,
int health_enabled,
int rrdpush_enabled,
RRDHOST *host = callocz(1, sizeof(RRDHOST));
host->rrd_update_every = update_every;
- host->rrd_history_entries = entries;
+ host->rrd_history_entries = align_entries_to_pagesize(memory_mode, entries);
host->rrd_memory_mode = memory_mode;
host->health_enabled = (memory_mode == RRD_MEMORY_MODE_NONE)? 0 : health_enabled;
host->rrdpush_enabled = (rrdpush_enabled && rrdpush_destination && *rrdpush_destination && rrdpush_api_key && *rrdpush_api_key);
", os %s"
", update every %d"
", memory mode %s"
- ", history entries %d"
+ ", history entries %ld"
", streaming %s"
" (to '%s' with api key '%s')"
", health %s"
, const char *guid
, const char *os
, int update_every
- , int history
+ , long history
, RRD_MEMORY_MODE mode
, int health_enabled
, int rrdpush_enabled
error("Host '%s' has an update frequency of %d seconds, but the wanted one is %d seconds.", host->hostname, host->rrd_update_every, update_every);
if(host->rrd_history_entries != history)
- error("Host '%s' has history of %d entries, but the wanted one is %d entries.", host->hostname, host->rrd_history_entries, history);
+ error("Host '%s' has history of %ld entries, but the wanted one is %ld entries.", host->hostname, host->rrd_history_entries, history);
if(host->rrd_memory_mode != mode)
error("Host '%s' has memory mode '%s', but the wanted one is '%s'.", host->hostname, rrd_memory_mode_name(host->rrd_memory_mode), rrd_memory_mode_name(mode));
}
#ifdef NETDATA_INTERNAL_CHECKS
- info("STREAM %s [receive from [%s]:%s]: client willing to stream metrics for host '%s' with machine_guid '%s': update every = %d, history = %d, memory mode = %s, health %s"
+ info("STREAM %s [receive from [%s]:%s]: client willing to stream metrics for host '%s' with machine_guid '%s': update every = %d, history = %ld, memory mode = %s, health %s"
, hostname
, client_ip
, client_port