3 int do_macos_mach_smi(int update_every, usec_t dt) {
6 static int do_cpu = -1;
8 if (unlikely(do_cpu == -1)) {
9 do_cpu = config_get_boolean("plugin:macos:mach_smi", "cpu utilization", 1);
14 // NEEDED BY: do_cpu, do_cpu_cores
17 // --------------------------------------------------------------------
22 error("DISABLED: system.cpu");
25 st = rrdset_find_bytype("system", "cpu");
27 st = rrdset_create("system", "cpu", NULL, "cpu", "system.cpu", "Total CPU utilization", "percentage", 100, update_every, RRDSET_TYPE_STACKED);
29 rrddim_add(st, "user", NULL, 1, 1, RRDDIM_PCENT_OVER_DIFF_TOTAL);
30 rrddim_add(st, "nice", NULL, 1, 1, RRDDIM_PCENT_OVER_DIFF_TOTAL);
31 rrddim_add(st, "system", NULL, 1, 1, RRDDIM_PCENT_OVER_DIFF_TOTAL);
32 rrddim_add(st, "interrupt", NULL, 1, 1, RRDDIM_PCENT_OVER_DIFF_TOTAL);
33 rrddim_add(st, "idle", NULL, 1, 1, RRDDIM_PCENT_OVER_DIFF_TOTAL);
34 rrddim_hide(st, "idle");
38 rrddim_set(st, "user", cp_time[0]);
39 rrddim_set(st, "nice", cp_time[1]);
40 rrddim_set(st, "system", cp_time[2]);
41 rrddim_set(st, "interrupt", cp_time[3]);
42 rrddim_set(st, "idle", cp_time[4]);