]> arthur.barton.de Git - netdata.git/blobdiff - src/macos_mach_smi.c
lower the memory footprint of dimensions by 1.5KB
[netdata.git] / src / macos_mach_smi.c
index 2d93c7a400fcfc76803d18a1d96c4a1087d4205d..18c4b93b451b3db7d0dfe4945096d6739cde24f1 100644 (file)
@@ -36,7 +36,7 @@ int do_macos_mach_smi(int update_every, usec_t dt) {
 
     if (likely(do_cpu)) {
         if (unlikely(HOST_CPU_LOAD_INFO_COUNT != 4)) {
-            error("FREEBSD: There are %d CPU states (4 was expected)", HOST_CPU_LOAD_INFO_COUNT);
+            error("MACOS: There are %d CPU states (4 was expected)", HOST_CPU_LOAD_INFO_COUNT);
             do_cpu = 0;
             error("DISABLED: system.cpu");
         } else {
@@ -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_PCENT_OVER_DIFF_TOTAL);
-                    rrddim_add(st, "nice", NULL, 1, 1, RRDDIM_PCENT_OVER_DIFF_TOTAL);
-                    rrddim_add(st, "system", NULL, 1, 1, RRDDIM_PCENT_OVER_DIFF_TOTAL);
-                    rrddim_add(st, "idle", NULL, 1, 1, RRDDIM_PCENT_OVER_DIFF_TOTAL);
+                    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_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_ABSOLUTE);
-                    rrddim_add(st, "wired",     NULL, system_pagesize, 1048576, RRDDIM_ABSOLUTE);
-                    rrddim_add(st, "throttled", NULL, system_pagesize, 1048576, RRDDIM_ABSOLUTE);
-                    rrddim_add(st, "compressor", NULL, system_pagesize, 1048576, RRDDIM_ABSOLUTE);
-                    rrddim_add(st, "inactive",  NULL, system_pagesize, 1048576, RRDDIM_ABSOLUTE);
-                    rrddim_add(st, "speculative", NULL, system_pagesize, 1048576, RRDDIM_ABSOLUTE);
-                    rrddim_add(st, "purgeable", NULL, system_pagesize, 1048576, RRDDIM_ABSOLUTE);
-                    rrddim_add(st, "free",      NULL, system_pagesize, 1048576, RRDDIM_ABSOLUTE);
+                    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);
                 }
                 else rrdset_next(st);
 
@@ -104,9 +104,9 @@ int do_macos_mach_smi(int update_every, usec_t dt) {
                 rrddim_set(st, "throttled", vm_statistics.throttled_count);
                 rrddim_set(st, "compressor", vm_statistics.compressor_page_count);
                 rrddim_set(st, "inactive",  vm_statistics.inactive_count);
-                rrddim_set(st, "speculative", vm_statistics.speculative_count);
                 rrddim_set(st, "purgeable", vm_statistics.purgeable_count);
-                rrddim_set(st, "free",      vm_statistics.free_count);
+                rrddim_set(st, "speculative", vm_statistics.speculative_count);
+                rrddim_set(st, "free",      (vm_statistics.free_count - vm_statistics.speculative_count));
                 rrdset_done(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_INCREMENTAL);
-                    rrddim_add(st, "out", NULL, -system_pagesize, 1024, RRDDIM_INCREMENTAL);
+                    rrddim_add(st, "in",  NULL, system_pagesize, 1024, RRDDIM_ALGORITHM_INCREMENTAL);
+                    rrddim_add(st, "out", NULL, -system_pagesize, 1024, RRDDIM_ALGORITHM_INCREMENTAL);
                 }
                 else rrdset_next(st);
 
@@ -135,15 +135,15 @@ int do_macos_mach_smi(int update_every, usec_t dt) {
                     st = rrdset_create("mem", "pgfaults", NULL, "system", NULL, "Memory Page Faults", "page faults/s", 500, update_every, RRDSET_TYPE_LINE);
                     st->isdetail = 1;
 
-                    rrddim_add(st, "memory",    NULL, 1, 1, RRDDIM_INCREMENTAL);
-                    rrddim_add(st, "cow",       NULL, 1, 1, RRDDIM_INCREMENTAL);
-                    rrddim_add(st, "pagein",    NULL, 1, 1, RRDDIM_INCREMENTAL);
-                    rrddim_add(st, "pageout",   NULL, 1, 1, RRDDIM_INCREMENTAL);
-                    rrddim_add(st, "compress",  NULL, 1, 1, RRDDIM_INCREMENTAL);
-                    rrddim_add(st, "decompress", NULL, 1, 1, RRDDIM_INCREMENTAL);
-                    rrddim_add(st, "zero_fill", NULL, 1, 1, RRDDIM_INCREMENTAL);
-                    rrddim_add(st, "reactivate", NULL, 1, 1, RRDDIM_INCREMENTAL);
-                    rrddim_add(st, "purge",     NULL, 1, 1, RRDDIM_INCREMENTAL);
+                    rrddim_add(st, "memory",    NULL, 1, 1, RRDDIM_ALGORITHM_INCREMENTAL);
+                    rrddim_add(st, "cow",       NULL, 1, 1, RRDDIM_ALGORITHM_INCREMENTAL);
+                    rrddim_add(st, "pagein",    NULL, 1, 1, RRDDIM_ALGORITHM_INCREMENTAL);
+                    rrddim_add(st, "pageout",   NULL, 1, 1, RRDDIM_ALGORITHM_INCREMENTAL);
+                    rrddim_add(st, "compress",  NULL, 1, 1, RRDDIM_ALGORITHM_INCREMENTAL);
+                    rrddim_add(st, "decompress", NULL, 1, 1, RRDDIM_ALGORITHM_INCREMENTAL);
+                    rrddim_add(st, "zero_fill", NULL, 1, 1, RRDDIM_ALGORITHM_INCREMENTAL);
+                    rrddim_add(st, "reactivate", NULL, 1, 1, RRDDIM_ALGORITHM_INCREMENTAL);
+                    rrddim_add(st, "purge",     NULL, 1, 1, RRDDIM_ALGORITHM_INCREMENTAL);
                 }
                 else rrdset_next(st);