我正在使用 Citrix XenServer C SDK 来获取 host_cpu 利用率的值。
知道 test/test_get_records.c 中表示该数据的单位是什么吗 生成以下输出..我期待百分位数:
请评论该数字与百分比值的关系。
最佳答案
看头文件,是一个double。 http://opensrcd.ca.com/ips/07400_4/include/xen/api/xen_host_cpu.h
根据您的计算机,您可能会尝试 %llf 而不是 %lf,但是...
我认为您应该使用它们的辅助函数来访问数据。例如:
/**
* Get the utilisation field of the given host_cpu.
*/
extern bool
xen_host_cpu_get_utilisation(xen_session *session, double *result, xen_host_cpu host_cpu);
关于c - 供使用的 XenServer C SDK 单元,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29492854/