...
The interval used for the test was for 1 second (this interval was used for the host and guest collectd cpu plugins, the virt plugin wouldn't go down to a 1 second configuration).
1 second was selected in order to get the timing differences between starting the plugin on the host and starting the plugin on the guest down to a lower value...
Tests were conducted with more/less an idle environment and will be repeated with a busy env.
Function used to convert nanoseconds virt metrics to percent:
static double cpu_ns_to_percent(unsigned int node_cpus,
unsigned long long cpu_time_old,
unsigned long long cpu_time_new) {
double percent = 0.0;
unsigned long long cpu_time_diff = 0;
double time_diff_sec = CDTIME_T_TO_DOUBLE(plugin_get_interval());
if (node_cpus != 0 && time_diff_sec != 0 && cpu_time_old != 0) {
cpu_time_diff = cpu_time_new - cpu_time_old;
percent = ((double)(100 * cpu_time_diff)) /
(time_diff_sec * node_cpus * NANOSEC_IN_SEC);
}
With Isolation
Core 10 and 11 were isolated from the OS using the isolcpus argument to grub command line and using virsh to Pin the vCPUs to those cores:
...