diff options
author | Costa Tsaousis (ktsaou) <costa@tsaousis.gr> | 2017-02-18 10:57:49 +0200 |
---|---|---|
committer | Costa Tsaousis (ktsaou) <costa@tsaousis.gr> | 2017-02-18 10:57:49 +0200 |
commit | 5b9054a89f2be6b0d47eaba8fc7cd5e923a9d35a (patch) | |
tree | 72667fb86dc79e506c6a4a196d0769f65dc2ea35 | |
parent | 3a21933ff4dbb05df94cf5e3fa221949e178450b (diff) |
split rrd.c into multiple files
49 files changed, 2364 insertions, 2273 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 893af80660..9dc59010cb 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -123,7 +123,7 @@ set(NETDATA_SOURCE_FILES src/web_client.h src/web_server.c src/web_server.h - ) + src/rrdhost.c src/rrdfamily.c src/rrdset.c src/rrddim.c) set(APPS_PLUGIN_SOURCE_FILES src/appconfig.c diff --git a/src/Makefile.am b/src/Makefile.am index bec3ef92d8..c562b27e7c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -30,7 +30,7 @@ endif netdata_SOURCES = \ appconfig.c appconfig.h \ - adaptive_resortable_list.c adaptive_resortable_list.h \ + adaptive_resortable_list.c \adaptive_resortable_list.h \ avl.c avl.h \ backends.c backends.h \ clocks.c clocks.h \ @@ -65,6 +65,10 @@ netdata_SOURCES = \ registry_db.c \ registry_log.c \ rrd.c rrd.h \ + rrddim.c \ + rrdfamily.c \ + rrdhost.c \ + rrdset.c \ rrd2json.c rrd2json.h \ storage_number.c storage_number.h \ unit_test.c unit_test.h \ diff --git a/src/backends.c b/src/backends.c index e1c886dc70..b1c10d9d06 100644 --- a/src/backends.c +++ b/src/backends.c @@ -240,28 +240,28 @@ void *backends_main(void *ptr) { RRDSET *chart_metrics = rrdset_find_localhost("netdata.backend_metrics"); if(!chart_metrics) { chart_metrics = rrdset_create("netdata", "backend_metrics", NULL, "backend", NULL, "Netdata Buffered Metrics", "metrics", 130600, frequency, RRDSET_TYPE_LINE); - rrddim_add(chart_metrics, "buffered", NULL, 1, 1, RRDDIM_ALGORITHM_ABSOLUTE); - rrddim_add(chart_metrics, "lost", NULL, 1, 1, RRDDIM_ALGORITHM_ABSOLUTE); - rrddim_add(chart_metrics, "sent", NULL, 1, 1, RRDDIM_ALGORITHM_ABSOLUTE); + rrddim_add(chart_metrics, "buffered", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); + rrddim_add(chart_metrics, "lost", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); + rrddim_add(chart_metrics, "sent", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); } RRDSET *chart_bytes = rrdset_find_localhost("netdata.backend_bytes"); if(!chart_bytes) { chart_bytes = rrdset_create("netdata", "backend_bytes", NULL, "backend", NULL, "Netdata Backend Data Size", "KB", 130610, frequency, RRDSET_TYPE_AREA); - rrddim_add(chart_bytes, "buffered", NULL, 1, 1024, RRDDIM_ALGORITHM_ABSOLUTE); - rrddim_add(chart_bytes, "lost", NULL, 1, 1024, RRDDIM_ALGORITHM_ABSOLUTE); - rrddim_add(chart_bytes, "sent", NULL, 1, 1024, RRDDIM_ALGORITHM_ABSOLUTE); - rrddim_add(chart_bytes, "received", NULL, 1, 1024, RRDDIM_ALGORITHM_ABSOLUTE); + rrddim_add(chart_bytes, "buffered", NULL, 1, 1024, RRD_ALGORITHM_ABSOLUTE); + rrddim_add(chart_bytes, "lost", NULL, 1, 1024, RRD_ALGORITHM_ABSOLUTE); + rrddim_add(chart_bytes, "sent", NULL, 1, 1024, RRD_ALGORITHM_ABSOLUTE); + rrddim_add(chart_bytes, "received", NULL, 1, 1024, RRD_ALGORITHM_ABSOLUTE); } RRDSET *chart_ops = rrdset_find_localhost("netdata.backend_ops"); if(!chart_ops) { chart_ops = rrdset_create("netdata", "backend_ops", NULL, "backend", NULL, "Netdata Backend Operations", "operations", 130630, frequency, RRDSET_TYPE_LINE); - rrddim_add(chart_ops, "write", NULL, 1, 1, RRDDIM_ALGORITHM_ABSOLUTE); - rrddim_add(chart_ops, "discard", NULL, 1, 1, RRDDIM_ALGORITHM_ABSOLUTE); - rrddim_add(chart_ops, "reconnect", NULL, 1, 1, RRDDIM_ALGORITHM_ABSOLUTE); - rrddim_add(chart_ops, "failure", NULL, 1, 1, RRDDIM_ALGORITHM_ABSOLUTE); - rrddim_add(chart_ops, "read", NULL, 1, 1, RRDDIM_ALGORITHM_ABSOLUTE); + rrddim_add(chart_ops, "write", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); + rrddim_add(chart_ops, "discard", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); + rrddim_add(chart_ops, "reconnect", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); + rrddim_add(chart_ops, "failure", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); + rrddim_add(chart_ops, "read", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); } /* @@ -274,15 +274,15 @@ void *backends_main(void *ptr) { RRDSET *chart_latency = rrdset_find_localhost("netdata.backend_latency"); if(!chart_latency) { chart_latency = rrdset_create("netdata", "backend_latency", NULL, "backend", NULL, "Netdata Backend Latency", "ms", 130620, frequency, RRDSET_TYPE_AREA); - rrddim_add(chart_latency, "latency", NULL, 1, 1000, RRDDIM_ALGORITHM_ABSOLUTE); + rrddim_add(chart_latency, "latency", NULL, 1, 1000, RRD_ALGORITHM_ABSOLUTE); } */ RRDSET *chart_rusage = rrdset_find_localhost("netdata.backend_thread_cpu"); if(!chart_rusage) { chart_rusage = rrdset_create("netdata", "backend_thread_cpu", NULL, "backend", NULL, "NetData Backend Thread CPU usage", "milliseconds/s", 130630, frequency, RRDSET_TYPE_STACKED); - rrddim_add(chart_rusage, "user", NULL, 1, 1000, RRDDIM_ALGORITHM_INCREMENTAL); - rrddim_add(chart_rusage, "system", NULL, 1, 1000, RRDDIM_ALGORITHM_INCREMENTAL); + rrddim_add(chart_rusage, "user", NULL, 1, 1000, RRD_ALGORITHM_INCREMENTAL); + rrddim_add(chart_rusage, "system", NULL, 1, 1000, RRD_ALGORITHM_INCREMENTAL); } // ------------------------------------------------------------------------ diff --git a/src/daemon.c b/src/daemon.c index e7f3b037fd..835c014a7a 100644 --- a/src/daemon.c +++ b/src/daemon.c @@ -27,7 +27,7 @@ void sig_handler_save(int signo) if(signo) { error_log_limit_unlimited(); info("Received signal %d to save the database...", signo); - rrdset_save_all(); + rrdhost_save_all(); error_log_limit_reset(); } } diff --git a/src/global_statistics.c b/src/global_statistics.c index ea23b15457..90f0699f7f 100644 --- a/src/global_statistics.c +++ b/src/global_statistics.c @@ -135,8 +135,8 @@ void global_statistics_charts(void) { "NetData Proc Plugin CPU usage", "milliseconds/s", 132000, rrd_update_every, RRDSET_TYPE_STACKED); - rrddim_add(stcpu_thread, "user", NULL, 1, 1000, RRDDIM_ALGORITHM_INCREMENTAL); - rrddim_add(stcpu_thread, "system", NULL, 1, 1000, RRDDIM_ALGORITHM_INCREMENTAL); + rrddim_add(stcpu_thread, "user", NULL, 1, 1000, RRD_ALGORITHM_INCREMENTAL); + rrddim_add(stcpu_thread, "system", NULL, 1, 1000, RRD_ALGORITHM_INCREMENTAL); } else rrdset_next(stcpu_thread); rrddim_set(stcpu_thread, "user", thread.ru_utime.tv_sec * 1000000ULL + thread.ru_utime.tv_usec); @@ -150,8 +150,8 @@ void global_statistics_charts(void) { stcpu = rrdset_create("netdata", "server_cpu", NULL, "netdata", NULL, "NetData CPU usage", "milliseconds/s", 130000, rrd_update_every, RRDSET_TYPE_STACKED); - rrddim_add(stcpu, "user", NULL, 1, 1000, RRDDIM_ALGORITHM_INCREMENTAL); - rrddim_add(stcpu, "system", NULL, 1, 1000, RRDDIM_ALGORITHM_INCREMENTAL); + rrddim_add(stcpu, "user", NULL, 1, 1000, RRD_ALGORITHM_INCREMENTAL); + rrddim_add(stcpu, "system", NULL, 1, 1000, RRD_ALGORITHM_INCREMENTAL); } else rrdset_next(stcpu); rrddim_set(stcpu, "user", me.ru_utime.tv_sec * 1000000ULL + me.ru_utime.tv_usec); @@ -165,7 +165,7 @@ void global_statistics_charts(void) { stclients = rrdset_create("netdata", "clients", NULL, "netdata", NULL, "NetData Web Clients", "connected clients", 130200, rrd_update_every, RRDSET_TYPE_LINE); - rrddim_add(stclients, "clients", NULL, 1, 1, RRDDIM_ALGORITHM_ABSOLUTE); + rrddim_add(stclients, "clients", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); } else rrdset_next(stclients); rrddim_set(stclients, "clients", gs.connected_clients); @@ -178,7 +178,7 @@ void global_statistics_charts(void) { streqs = rrdset_create("netdata", "requests", NULL, "netdata", NULL, "NetData Web Requests", "requests/s", 130300, rrd_update_every, RRDSET_TYPE_LINE); - rrddim_add(streqs, "requests", NULL, 1, 1, RRDDIM_ALGORITHM_INCREMENTAL); + rrddim_add(streqs, "requests", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); } else rrdset_next(streqs); rrddim_set(streqs, "requests", (collected_number) gs.web_requests); @@ -191,8 +191,8 @@ void global_statistics_charts(void) { stbytes = rrdset_create("netdata", "net", NULL, "netdata", NULL, "NetData Network Traffic", "kilobits/s", 130000, rrd_update_every, RRDSET_TYPE_AREA); - rrddim_add(stbytes, "in", NULL, 8, 1024, RRDDIM_ALGORITHM_INCREMENTAL); - rrddim_add(stbytes, "out", NULL, -8, 1024, RRDDIM_ALGORITHM_INCREMENTAL); + rrddim_add(stbytes, "in", NULL, 8, 1024, RRD_ALGORITHM_INCREMENTAL); + rrddim_add(stbytes, "out", NULL, -8, 1024, RRD_ALGORITHM_INCREMENTAL); } else rrdset_next(stbytes); rrddim_set(stbytes, "in", (collected_number) gs.bytes_received); @@ -206,8 +206,8 @@ void global_statistics_charts(void) { stduration = rrdset_create("netdata", "response_time", NULL, "netdata", NULL, "NetData API Response Time", "ms/request", 130400, rrd_update_every, RRDSET_TYPE_LINE); - rrddim_add(stduration, "average", NULL, 1, 1000, RRDDIM_ALGORITHM_ABSOLUTE); - rrddim_add(stduration, "max", NULL, 1, 1000, RRDDIM_ALGORITHM_ABSOLUTE); + rrddim_add(stduration, "average", NULL, 1, 1000, RRD_ALGORITHM_ABSOLUTE); + rrddim_add(stduration, "max", NULL, 1, 1000, RRD_ALGORITHM_ABSOLUTE); } else rrdset_next(stduration); uint64_t gweb_usec = gs.web_usec; @@ -238,7 +238,7 @@ void global_statistics_charts(void) { "NetData API Responses Compression Savings Ratio", "percentage", 130500, rrd_update_every, RRDSET_TYPE_LINE); - rrddim_add(stcompression, "savings", NULL, 1, 1000, RRDDIM_ALGORITHM_ABSOLUTE); + rrddim_add(stcompression, "savings", NULL, 1, 1000, RRD_ALGORITHM_ABSOLUTE); } else rrdset_next(stcompression); // since we don't lock here to read the global statistics @@ -194,13 +194,13 @@ int do_ipc(int update_every, usec_t dt) { semaphores = rrdset_find_localhost("system.ipc_semaphores"); if(!semaphores) { semaphores = rrdset_create("system", "ipc_semaphores", NULL, "ipc semaphores", NULL, "IPC Semaphores", "semaphores", 1000, rrd_update_every, RRDSET_TYPE_AREA); - rrddim_add(semaphores, "semaphores", NULL, 1, 1, RRDDIM_ALGORITHM_ABSOLUTE); + rrddim_add(semaphores, "semaphores", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); } arrays = rrdset_find_localhost("system.ipc_semaphore_arrays"); if(!arrays) { arrays = rrdset_create("system", "ipc_semaphore_arrays", NULL, "ipc semaphores", NULL, "IPC Semaphore Arrays", "arrays", 1000, rrd_update_every, RRDSET_TYPE_AREA); - rrddim_add(arrays, "arrays", NULL, 1, 1, RRDDIM_ALGORITHM_ABSOLUTE); + rrddim_add(arrays, "arrays", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); } } diff --git a/src/macos_fw.c b/src/macos_fw.c index 7917855d3a..f9a3a6b0ec 100644 --- a/src/macos_fw.c +++ b/src/macos_fw.c @@ -140,8 +140,8 @@ int do_macos_iokit(int update_every, usec_t dt) { if (unlikely(!st)) { st = rrdset_create("disk", diskstat.name, NULL, diskstat.name, "disk.io", "Disk I/O Bandwidth", "kilobytes/s", 2000, update_every, RRDSET_TYPE_AREA); - rrddim_add(st, "reads", NULL, 1, 1024, RRDDIM_ALGORITHM_INCREMENTAL); - rrddim_add(st, "writes", NULL, -1, 1024, RRDDIM_ALGORITHM_INCREMENTAL); + rrddim_add(st, "reads", NULL, 1, 1024, RRD_ALGORITHM_INCREMENTAL); + rrddim_add(st, "writes", NULL, -1, 1024, RRD_ALGORITHM_INCREMENTAL); } else rrdset_next(st); @@ -166,8 +166,8 @@ int do_macos_iokit(int update_every, usec_t dt) { st = rrdset_create("disk_ops", diskstat.name, NULL, diskstat.name, "disk.ops", "Disk Completed I/O Operations", "operations/s", 2001, update_every, RRDSET_TYPE_LINE); st->isdetail = 1; - rrddim_add(st, "reads", NULL, 1, 1, RRDDIM_ALGORITHM_INCREMENTAL); - rrddim_add(st, "writes", NULL, -1, 1, RRDDIM_ALGORITHM_INCREMENTAL); + rrddim_add(st, "reads", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); + rrddim_add(st, "writes", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL); } else rrdset_next(st); @@ -192,7 +192,7 @@ int do_macos_iokit(int update_every, usec_t dt) { st = rrdset_create("disk_util", diskstat.name, NULL, diskstat.name, "disk.util", "Disk Utilization Time", "% of time working", 2004, update_every, RRDSET_TYPE_AREA); st->isdetail = 1; - rrddim_add(st, "utilization", NULL, 1, 10000000, RRDDIM_ALGORITHM_INCREMENTAL); + rrddim_add(st, "utilization", NULL, 1, 10000000, RRD_ALGORITHM_INCREMENTAL); } else rrdset_next(st); @@ -217,8 +217,8 @@ int do_macos_iokit(int update_every, usec_t dt) { st = rrdset_create("disk_iotime", diskstat.name, NULL, diskstat.name, "disk.iotime", "Disk Total I/O Time", "milliseconds/s", 2022, update_every, RRDSET_TYPE_LINE); st->isdetail = 1; - rrddim_add(st, "reads", NULL, 1, 1000000, RRDDIM_ALGORITHM_INCREMENTAL); - rrddim_add(st, "writes", NULL, -1, 1000000, RRDDIM_ALGORITHM_INCREMENTAL); + rrddim_add(st, "reads", NULL, 1, 1000000, RRD_ALGORITHM_INCREMENTAL); + rrddim_add(st, "writes", NULL, -1, 1000000, RRD_ALGORITHM_INCREMENTAL); } else rrdset_next(st); @@ -241,8 +241,8 @@ int do_macos_iokit(int update_every, usec_t dt) { st = rrdset_create("disk_await", diskstat.name, NULL, diskstat.name, "disk.await", "Average Completed I/O Operation Time", "ms per operation", 2005, update_every, RRDSET_TYPE_LINE); st->isdetail = 1; - rrddim_add(st, "reads", NULL, 1, 1000000, RRDDIM_ALGORITHM_ABSOLUTE); - rrddim_add(st, "writes", NULL, -1, 1000000, RRDDIM_ALGORITHM_ABSOLUTE); + rrddim_add(st, "reads", NULL, 1, 1000000, RRD_ALGORITHM_ABSOLUTE); + rrddim_add(st, "writes", NULL, -1, 1000000, RRD_ALGORITHM_ABSOLUTE); } else rrdset_next(st); @@ -259,8 +259,8 @@ int do_macos_iokit(int update_every, usec_t dt) { st = rrdset_create("disk_avgsz", diskstat.name, NULL, diskstat.name, "disk.avgsz", "Average Completed I/O Operation Bandwidth", "kilobytes per operation", 2006, update_every, RRDSET_TYPE_AREA); st->isdetail = 1; - rrddim_add(st, "reads", NULL, 1, 1024, RRDDIM_ALGORITHM_ABSOLUTE); - rrddim_add(st, "writes", NULL, -1, 1024, RRDDIM_ALGORITHM_ABSOLUTE); + rrddim_add(st, "reads", NULL, 1, 1024, RRD_ALGORITHM_ABSOLUTE); + rrddim_add(st, "writes", NULL, -1, 1024, RRD_ALGORITHM_ABSOLUTE); } else rrdset_next(st); @@ -277,7 +277,7 @@ int do_macos_iokit(int update_every, usec_t dt) { st = rrdset_create("disk_svctm", diskstat.name, NULL, diskstat.name, "disk.svctm", "Average Service Time", "ms per operation", 2007, update_every, RRDSET_TYPE_LINE); st->isdetail = 1; - rrddim_add(st, "svctm", NULL, 1, 1000000, RRDDIM_ALGORITHM_ABSOLUTE); + rrddim_add(st, "svctm", NULL, 1, 1000000, RRD_ALGORITHM_ABSOLUTE); } else rrdset_next(st); @@ -304,8 +304,8 @@ int do_macos_iokit(int update_every, usec_t dt) { st = rrdset_find_bytype_localhost("system", "io"); if (unlikely(!st)) { st = rrdset_create("system", "io", NULL, "disk", NULL, "Disk I/O", "kilobytes/s", 150, update_every, RRDSET_TYPE_AREA); - rrddim_add(st, "in", NULL, 1, 1024, RRDDIM_ALGORITHM_INCREMENTAL); - rrddim_add(st, "out", NULL, -1, 1024, RRDDIM_ALGORITHM_INCREMENTAL); + rrddim_add(st, "in", NULL, 1, 1024, RRD_ALGORITHM_INCREMENTAL); + rrddim_add(st, "out", NULL, -1, 1024, RRD_ALGORITHM_INCREMENTAL); } else rrdset_next(st); @@ -347,10 +347,10 @@ int do_macos_iokit(int update_every, usec_t dt) { update_every, RRDSET_TYPE_STACKED); - rrddim_add(st, "avail", NULL, mntbuf[i].f_bsize, GIGA_FACTOR, RRDDIM_ALGORITHM_ABSOLUTE); - rrddim_add(st, "used", NULL, mntbuf[i].f_bsize, GIGA_FACTOR, RRDDIM_ALGORITHM_ABSOLUTE); + rrddim_add(st, "avail", NULL, mntbuf[i].f_bsize, GIGA_FACTOR, RRD_ALGORITHM_ABSOLUTE); + rrddim_add(st, "used", NULL, mntbuf[i].f_bsize, GIGA_FACTOR, RRD_ALGORITHM_ABSOLUTE); rrddim_add(st, "reserved_for_root", "reserved for root", mntbuf[i].f_bsize, GIGA_FACTOR, - RRDDIM_ALGORITHM_ABSOLUTE); + RRD_ALGORITHM_ABSOLUTE); } else rrdset_next(st); @@ -369,9 +369,9 @@ int do_macos_iokit(int update_every, usec_t dt) { st = rrdset_create("disk_inodes", mntbuf[i].f_mntonname, NULL, mntbuf[i].f_mntonname, "disk.inodes", title, "Inodes", 2024, update_every, RRDSET_TYPE_STACKED); - rrddim_add(st, "avail", NULL, 1, 1, RRDDIM_ALGORITHM_ABSOLUTE); - rrddim_add(st, "used", NULL, 1, 1, RRDDIM_ALGORITHM_ABSOLUTE); - rrddim_add(st, "reserved_for_root", "reserved for root", 1, 1, RRDDIM_ALGORITHM_ABSOLUTE); + rrddim_add(st, "avail", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); + rrddim_add(st, "used", NULL, 1, 1, RRD_ALGORITHM_ABSOLUTE); + rrddim_add(st, "reserved_for_root", "reserved for root", 1, 1, RRD_ALGORITHM_ABSOLUTE); } else rrdset_next(st); @@ -402,8 +402,8 @@ int do_macos_iokit(int update_every, usec_t dt) { if (unlikely(!st)) { st = rrdset_create("net", ifa->ifa_name, NULL, ifa->ifa_name, "net.net", "Bandwidth", "kilobits/s", 7000, update_every, RRDSET_TYPE_AREA); - rrddim_add(st, "received", NULL, 8, 1024, RRDDIM_ALGORITHM_INCREMENTAL); - rrddim_add(st, "sent", NULL, -8, 1024, RRDDIM_ALGORITHM_INCREMENTAL); + rrddim_add(st, "received", NULL, 8, 1024, RRD_ALGORITHM_INCREMENTAL); + rrddim_add(st, "sent", NULL, -8, 1024, RRD_ALGORITHM_INCREMENTAL); } else rrdset_next(st); @@ -418,10 +418,10 @@ int do_macos_iokit(int update_every, usec_t dt) { st = rrdset_create("net_packets", ifa->ifa_name, NULL, ifa->ifa_name, "net.packets", "Packets", "packets/s", 7001, update_every, RRDSET_TYPE_LINE); st->isdetail = 1; - rrddim_add(st, "received", NULL, 1, 1, RRDDIM_ALGORITHM_INCREMENTAL); - rrddim_add(st, "sent", NULL, -1, 1, RRDDIM_ALGORITHM_INCREMENTAL); - rrddim_add(st, "multicast_received", NULL, 1, 1, RRDDIM_ALGORITHM_INCREMENTAL); - rrddim_add(st, "multicast_sent", NULL, -1, 1, RRDDIM_ALGORITHM_INCREMENTAL); + rrddim_add(st, "received", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); + rrddim_add(st, "sent", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL); + rrddim_add(st, "multicast_received", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); + rrddim_add(st, "multicast_sent", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL); } else rrdset_next(st); @@ -438,8 +438,8 @@ int do_macos_iokit(int update_every, usec_t dt) { st = rrdset_create("net_errors", ifa->ifa_name, NULL, ifa->ifa_name, "net.errors", "Interface Errors", "errors/s", 7002, update_every, RRDSET_TYPE_LINE); st->isdetail = 1; - rrddim_add(st, "inbound", NULL, 1, 1, RRDDIM_ALGORITHM_INCREMENTAL); - rrddim_add(st, "outbound", NULL, -1, 1, RRDDIM_ALGORITHM_INCREMENTAL); + rrddim_add(st, "inbound", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); + rrddim_add(st, "outbound", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL); } else rrdset_next(st); @@ -454,7 +454,7 @@ int do_macos_iokit(int update_every, usec_t dt) { st = rrdset_create("net_drops", ifa->ifa_name, NULL, ifa->ifa_name, "net.drops", "Interface Drops", "drops/s", 7003, update_every, RRDSET_TYPE_LINE); st->isdetail = 1; - rrddim_add(st, "inbound", NULL, 1, 1, RRDDIM_ALGORITHM_INCREMENTAL); + rrddim_add(st, "inbound", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); } else rrdset_next(st); @@ -468,9 +468,9 @@ int do_macos_iokit(int update_every, usec_t dt) { st = rrdset_create("net_events", ifa->ifa_name, NULL, ifa->ifa_name, "net.events", "Network Interface Events", "events/s", 7006, update_every, RRDSET_TYPE_LINE); st->isdetail = 1; - rrddim_add(st, "frames", NULL, 1, 1, RRDDIM_ALGORITHM_INCREMENTAL); - rrddim_add(st, "collisions", NULL, -1, 1, RRDDIM_ALGORITHM_INCREMENTAL); - rrddim_add(st, "carrier", NULL, -1, 1, RRDDIM_ALGORITHM_INCREMENTAL); + rrddim_add(st, "frames", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL); + rrddim_add(st, "collisions", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL); + rrddim_add(st, "carrier", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL); } else rrdset_next(st); diff --git a/src/macos_mach_smi.c b/src/macos_mach_smi.c index 60da6d7a3f..9578a7af7d 100644 --- a/src/macos_mach_smi.c +++ b/src/macos_mach_smi.c @@ -52,10 +52,10 @@ int do_macos_mach_smi(int update_every, usec_t dt) { if (unlikely(!st)) { st = rrdset_create("system", "cpu", NULL, "cpu", "system.cpu", "Total CPU utilization", "percentage", 100, update_every, RRDSET_TYPE_STACKED); - rrddim_add(st, "user", NULL, 1, 1, RRDDIM_ALGORITHM_PCENT_OVER_DIFF_TOTAL); - rrddim_add(st, "nice", NULL, 1, 1, RRDDIM_ALGORITHM_PCENT_OVER_DIFF_TOTAL); - rrddim_add(st, "system", NULL, 1, 1, RRDDIM_ALGORITHM_PCENT_OVER_DIFF_TOTAL); - rrddim_add(st, "idle", NULL, 1, 1, RRDDIM_ALGORITHM_PCENT_OVER_DIFF_TOTAL); + rrddim_add(st, "user", NULL, 1, 1, RRD_ALGORITHM_PCENT_OVER_DIFF_TOTAL); + rrddim_add(st, "nice", NULL, 1, 1, RRD_ALGORITHM_PCENT_OVER_DIFF_TOTAL); + rrddim_add(st, "system", NULL, 1, 1, RRD_ALGORITHM_PCENT_OVER_DIFF_TOTAL); + rrddim_add(st, "idle", NULL, 1, 1, RRD_ALGORITHM_PCENT_OVER_DIFF_TOTAL); rrddim_hide(st, "idle"); } else rrdset_next(st); @@ -88,14 +88,14 @@ int do_macos_mach_smi(int update_every, usec_t dt) { if (unlikely(!st)) { st = rrdset_create("system", "ram", NULL, "ram", NULL, "System RAM", "MB", 200, update_every, RRDSET_TYPE_STACKED); - rrddim_add(st, "active", NULL, system_pagesize, 1048576, RRDDIM_ALGORITHM_ABSOLUTE); - rrddim_add(st, "wired", NULL, system_pagesize, 1048576, RRDDIM_ALGORITHM_ABSOLUTE); - rrddim_add(st, "throttled", NULL, system_pagesize, 1048576, RRDDIM_ALGORITHM_ABSOLUTE); - rrddim_add(st, "compressor", NULL, system_pagesize, 1048576, RRDDIM_ALGORITHM_ABSOLUTE); - rrddim_add(st, "inactive", NULL, system_pagesize, 1048576, RRDDIM_ALGORITHM_ABSOLUTE); - rrddim_add(st, "purgeable", NULL, system_pagesize, 1048576, RRDDIM_ALGORITHM_ABSOLUTE); - rrddim_add(st, "speculative", NULL, system_pagesize, 1048576, RRDDIM_ALGORITHM_ABSOLUTE); - rrddim_add(st, "free", NULL, system_pagesize, 1048576, RRDDIM_ALGORITHM_ABSOLUTE); + rrddim_add(st, "active", NULL, system_pagesize, 1048576, RRD_ALGORITHM_ABSOLUTE); + rrddim_add(st, "wired", NULL, system_pagesize, 1048576, RRD_ALGORITHM_ABSOLUTE); + rrddim_add(st, "throttled", NULL, system_pagesize, 1048576, RRD_ALGORITHM_ABSOLUTE); + rrddim_add(st, "compressor", NULL, system_pagesize, 1048576, RRD_ALGORITHM_ABSOLUTE); + rrddim_add(st, "inactive", NULL, system_pagesize, 1048576, RRD_ALGORITHM_ABSOLUTE); + rrddim_add(st, "purgeable", NULL, system_pagesize, 1048576, RRD_ALGORITHM_ABSOLUTE); + rrddim_add(st, "speculative", NULL, system_pagesize, 1048576, RRD_ALGORITHM_ABSOLUTE); + rrddim_add(st, "free", NULL, system_pagesize, 1048576, RRD_ALGORITHM_ABSOLUTE); } else rrdset_next(st); @@ -117,8 +117,8 @@ int do_macos_mach_smi(int update_every, usec_t dt) { if (unlikely(!st)) { st = rrdset_create("system", "swapio", NULL, "swap", NULL, "Swap I/O", "kilobytes/s", 250, update_every, RRDSET_TYPE_AREA); - rrddim_add(st, "in", NULL, system_pagesize, 1024, RRDDIM_ALGORITHM_INCREMENTAL); - rrddim_add(st, "out", NULL, -system_pagesize, 1024, RRDDIM_ALGORITHM_INCREMENTAL); + rrddim_add(st, "in", NULL, system_pagesize, 1024, RRD_ALGORITHM_INCREMENTAL); + rrddim_add(st, "out", NULL, -system_pagesize, 1024, RRD_ALGORITHM_INCREMENTAL); } else rrdset_next(st); |