summaryrefslogtreecommitdiffstats
path: root/src/rrdhost.c
diff options
context:
space:
mode:
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>2017-02-18 20:42:29 +0200
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>2017-02-22 01:00:23 +0200
commit99e33cc6d52402d77c2be0409386461281e86be0 (patch)
tree7422264915059d260d6dfe442c83ec6b1965e3bd /src/rrdhost.c
parent29a6415a875477fb8dcac2a06cf51f6426fbb807 (diff)
remove references to localhost from registry - now the host is dynamic at the registry API calls
Diffstat (limited to 'src/rrdhost.c')
-rw-r--r--src/rrdhost.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/rrdhost.c b/src/rrdhost.c
index e899f69dfe..d28cea3ec7 100644
--- a/src/rrdhost.c
+++ b/src/rrdhost.c
@@ -208,7 +208,7 @@ void rrdhost_free(RRDHOST *host) {
pthread_rwlock_unlock(&st->rwlock);
- if(st->mapped == RRD_MEMORY_MODE_SAVE || st->mapped == RRD_MEMORY_MODE_MAP) {
+ if(st->rrd_memory_mode == RRD_MEMORY_MODE_SAVE || st->rrd_memory_mode == RRD_MEMORY_MODE_MAP) {
debug(D_RRD_CALLS, "Unmapping stats '%s'.", st->name);
munmap(st, st->memsize);
}
@@ -244,14 +244,14 @@ void rrdhost_save(RRDHOST *host) {
for(st = host->rrdset_root; st ; st = st->next) {
pthread_rwlock_rdlock(&st->rwlock);
- if(st->mapped == RRD_MEMORY_MODE_SAVE) {
- debug(D_RRD_CALLS, "Saving stats '%s' to '%s'.", st->name, st->cache_filename);
+ if(st->rrd_memory_mode == RRD_MEMORY_MODE_SAVE) {
+ debug(D_RRD_STATS, "Saving stats '%s' to '%s'.", st->name, st->cache_filename);
savememory(st->cache_filename, st, st->memsize);
}
for(rd = st->dimensions; rd ; rd = rd->next) {
- if(likely(rd->memory_mode == RRD_MEMORY_MODE_SAVE)) {
- debug(D_RRD_CALLS, "Saving dimension '%s' to '%s'.", rd->name, rd->cache_filename);
+ if(likely(rd->rrd_memory_mode == RRD_MEMORY_MODE_SAVE)) {
+ debug(D_RRD_STATS, "Saving dimension '%s' to '%s'.", rd->name, rd->cache_filename);
savememory(rd->cache_filename, rd, rd->memsize);
}
}
@@ -279,6 +279,8 @@ void rrdhost_free_all(void) {
}
void rrdhost_save_all(void) {
+ info("Saving database...");
+
RRDHOST *host;
for(host = localhost; host ; host = host->next)
rrdhost_save(host);