From 51f1f884e710bd7c054b62f486cfbce48d969ea1 Mon Sep 17 00:00:00 2001 From: Rasmus Hansen Date: Tue, 23 Jun 2020 12:48:19 +0200 Subject: [PATCH 1/2] Add hyperv queries example Signed-off-by: D'ALMEIDA Jorge <67072186+JDA88@users.noreply.github.com> --- docs/collector.hyperv.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/collector.hyperv.md b/docs/collector.hyperv.md index 135321ee..29258a06 100644 --- a/docs/collector.hyperv.md +++ b/docs/collector.hyperv.md @@ -96,7 +96,18 @@ Name | Description | Type | Labels _This collector does not yet have explained examples, we would appreciate your help adding them!_ ## Useful queries -_This collector does not yet have any useful queries added, we would appreciate your help adding them!_ +Percent of physical CPU ressources used per VM (on instance "localhost") +``` +(sum (rate(windows_hyperv_vm_cpu_hypervisor_run_time{instance="localhost"}[1m]))) / ignoring(vm) group_left max (windows_cs_logical_processors{instance="localhost"}) / 100000 +``` +Percent of physical CPU ressources used by all VMs (on all monitored hosts) +``` +(sum by (instance)(rate(windows_hyperv_vm_cpu_total_run_time{}[1m]))) / max by (instance)(windows_cs_logical_processors{}) / 100000 +``` +Percent of physical CPU ressources by the Hosts himself (on all monitored hosts) +``` +(sum by (instance)(rate(windows_hyperv_host_cpu_total_run_time{}[1m]))) / sum by (instance)(windows_cs_logical_processors{}) / 100000 +``` ## Alerting examples _This collector does not yet have alerting examples, we would appreciate your help adding them!_ From 5c7c0aaa69aa31c2f7264e8b07896ec036f02bfd Mon Sep 17 00:00:00 2001 From: Calle Pettersson Date: Sun, 28 Jun 2020 12:19:43 +0200 Subject: [PATCH 2/2] Apply suggestions from code review Signed-off-by: Calle Pettersson --- docs/collector.hyperv.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/collector.hyperv.md b/docs/collector.hyperv.md index 29258a06..919a0070 100644 --- a/docs/collector.hyperv.md +++ b/docs/collector.hyperv.md @@ -96,15 +96,15 @@ Name | Description | Type | Labels _This collector does not yet have explained examples, we would appreciate your help adding them!_ ## Useful queries -Percent of physical CPU ressources used per VM (on instance "localhost") +Percent of physical CPU resources used per VM (on instance "localhost") ``` (sum (rate(windows_hyperv_vm_cpu_hypervisor_run_time{instance="localhost"}[1m]))) / ignoring(vm) group_left max (windows_cs_logical_processors{instance="localhost"}) / 100000 ``` -Percent of physical CPU ressources used by all VMs (on all monitored hosts) +Percent of physical CPU resources used by all VMs (on all monitored hosts) ``` (sum by (instance)(rate(windows_hyperv_vm_cpu_total_run_time{}[1m]))) / max by (instance)(windows_cs_logical_processors{}) / 100000 ``` -Percent of physical CPU ressources by the Hosts himself (on all monitored hosts) +Percent of physical CPU resources by the hosts themselves (on all monitored hosts) ``` (sum by (instance)(rate(windows_hyperv_host_cpu_total_run_time{}[1m]))) / sum by (instance)(windows_cs_logical_processors{}) / 100000 ```