diff --git a/src/cpu.c b/src/cpu.c
index d194872f0fd42005b64775e65521b9367497edeb..1ac5b4a3b94a9cea50835485befc4adf7c934b88 100644 (file)
--- a/src/cpu.c
+++ b/src/cpu.c
/* Commits the number of cores */
static void cpu_commit_num_cpu (gauge_t num_cpu) /* {{{ */
{
-//// static void submit_value (int cpu_num, int cpu_state, const char *type, value_t value)
value_t values[1];
value_list_t vl = VALUE_LIST_INIT;
- /// memcpy(&values[0], &value, sizeof(value));
values[0].gauge = num_cpu;
vl.values = values;
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "cpu", sizeof (vl.plugin));
- sstrncpy (vl.type, "gauge", sizeof (vl.type));
- sstrncpy (vl.type_instance, "ncpu",
- sizeof (vl.type_instance));
+ sstrncpy (vl.type, "count", sizeof (vl.type));
plugin_dispatch_values (&vl);
} /* }}} void cpu_commit_num_cpu */
};
if (report_num_cpu)
- {
cpu_commit_num_cpu ((gauge_t) global_cpu_num);
- }
if (report_by_state && report_by_cpu && !report_percent)
{
host_t cpu_host;
- for (int cpu = 0; cpu < cpu_list_len; cpu++)
+ for (mach_msg_type_number_t cpu = 0; cpu < cpu_list_len; cpu++)
{
cpu_host = 0;
cpu_info_len = PROCESSOR_BASIC_INFO_COUNT;