[PATCH] Number of CPUs in Host's Basic Information.

Support to provide the information of the number of online CPUs present in the Host system. Also, updated English help page to express the new information. Signed-off-by: Paulo Vital <pvital@linux.vnet.ibm.com> --- src/kimchi/model/host.py | 1 + ui/pages/help/en_US/host.dita | 4 ++-- ui/pages/tabs/host.html.tmpl | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/kimchi/model/host.py b/src/kimchi/model/host.py index 1bc3ca2..ca197c1 100644 --- a/src/kimchi/model/host.py +++ b/src/kimchi/model/host.py @@ -89,6 +89,7 @@ class HostModel(object): res['cpu'] = line.split(':')[1].strip() break + res['num_cpu'] = psutil.NUM_CPUS res['memory'] = psutil.TOTAL_PHYMEM # Include IBM PowerKVM name to supported distro names diff --git a/ui/pages/help/en_US/host.dita b/ui/pages/help/en_US/host.dita index 335c51c..0dcb670 100644 --- a/ui/pages/help/en_US/host.dita +++ b/ui/pages/help/en_US/host.dita @@ -24,8 +24,8 @@ to the host system, if it is not already connected.</li> <dlentry> <dt>Basic information</dt> <dd>This section displays the host operating system distribution, -version, and code name, as well as the processor type and amount of -memory in GB.</dd> +version, and code name, as well as the processor type, the number of +online CPUs and amount of memory in GB.</dd> </dlentry><dlentry> <dt>System statistics</dt> <dd>This section displays graphs to show statistics for CPU, memory, diff --git a/ui/pages/tabs/host.html.tmpl b/ui/pages/tabs/host.html.tmpl index 8641962..57c7cee 100644 --- a/ui/pages/tabs/host.html.tmpl +++ b/ui/pages/tabs/host.html.tmpl @@ -75,6 +75,10 @@ <div class="section-value">{cpu}</div> </div> <div class="section-row"> + <div class="section-label">$_("CPU(s)")</div> + <div class="section-value">{num_cpu}</div> + </div> + <div class="section-row"> <div class="section-label">$_("Memory")</div> <div class="section-value">{memory}</div> </div> -- 1.9.3

Reviewed-by: Daniel Barboza <danielhb@linux.vnet.ibm.com> Tested-by: Daniel Barboza <danielhb@linux.vnet.ibm.com> On 10/27/2014 06:45 PM, Paulo Vital wrote:
Support to provide the information of the number of online CPUs present in the Host system.
Also, updated English help page to express the new information.
Signed-off-by: Paulo Vital <pvital@linux.vnet.ibm.com> --- src/kimchi/model/host.py | 1 + ui/pages/help/en_US/host.dita | 4 ++-- ui/pages/tabs/host.html.tmpl | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/kimchi/model/host.py b/src/kimchi/model/host.py index 1bc3ca2..ca197c1 100644 --- a/src/kimchi/model/host.py +++ b/src/kimchi/model/host.py @@ -89,6 +89,7 @@ class HostModel(object): res['cpu'] = line.split(':')[1].strip() break
+ res['num_cpu'] = psutil.NUM_CPUS res['memory'] = psutil.TOTAL_PHYMEM
# Include IBM PowerKVM name to supported distro names diff --git a/ui/pages/help/en_US/host.dita b/ui/pages/help/en_US/host.dita index 335c51c..0dcb670 100644 --- a/ui/pages/help/en_US/host.dita +++ b/ui/pages/help/en_US/host.dita @@ -24,8 +24,8 @@ to the host system, if it is not already connected.</li> <dlentry> <dt>Basic information</dt> <dd>This section displays the host operating system distribution, -version, and code name, as well as the processor type and amount of -memory in GB.</dd> +version, and code name, as well as the processor type, the number of +online CPUs and amount of memory in GB.</dd> </dlentry><dlentry> <dt>System statistics</dt> <dd>This section displays graphs to show statistics for CPU, memory, diff --git a/ui/pages/tabs/host.html.tmpl b/ui/pages/tabs/host.html.tmpl index 8641962..57c7cee 100644 --- a/ui/pages/tabs/host.html.tmpl +++ b/ui/pages/tabs/host.html.tmpl @@ -75,6 +75,10 @@ <div class="section-value">{cpu}</div> </div> <div class="section-row"> + <div class="section-label">$_("CPU(s)")</div> + <div class="section-value">{num_cpu}</div> + </div> + <div class="section-row"> <div class="section-label">$_("Memory")</div> <div class="section-value">{memory}</div> </div>

On Power, this doesn't seem to reflect the real number of cores.
print psutil.NUM_CPUS 14
So are we going for CPUs (and let the user figure out how many virtual CPUs he/she can consoume), or cores (which I think is more useful)? For SMT/hyperthreading , I'm using ppc64_cpu and virsh capabilities: <capabilities> <host> <uuid>412bb869-1795-46e9-9bb3-dfe12f3bb45d</uuid> <cpu> <arch>x86_64</arch> <model>SandyBridge</model> <vendor>Intel</vendor> <topology sockets='1' cores='2' threads='2'/> $ ppc64_cpu --cores-on On 10/27/2014 03:45 PM, Paulo Vital wrote:
Support to provide the information of the number of online CPUs present in the Host system.
Also, updated English help page to express the new information.
Signed-off-by: Paulo Vital <pvital@linux.vnet.ibm.com> --- src/kimchi/model/host.py | 1 + ui/pages/help/en_US/host.dita | 4 ++-- ui/pages/tabs/host.html.tmpl | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/kimchi/model/host.py b/src/kimchi/model/host.py index 1bc3ca2..ca197c1 100644 --- a/src/kimchi/model/host.py +++ b/src/kimchi/model/host.py @@ -89,6 +89,7 @@ class HostModel(object): res['cpu'] = line.split(':')[1].strip() break
+ res['num_cpu'] = psutil.NUM_CPUS res['memory'] = psutil.TOTAL_PHYMEM
# Include IBM PowerKVM name to supported distro names diff --git a/ui/pages/help/en_US/host.dita b/ui/pages/help/en_US/host.dita index 335c51c..0dcb670 100644 --- a/ui/pages/help/en_US/host.dita +++ b/ui/pages/help/en_US/host.dita @@ -24,8 +24,8 @@ to the host system, if it is not already connected.</li> <dlentry> <dt>Basic information</dt> <dd>This section displays the host operating system distribution, -version, and code name, as well as the processor type and amount of -memory in GB.</dd> +version, and code name, as well as the processor type, the number of +online CPUs and amount of memory in GB.</dd> </dlentry><dlentry> <dt>System statistics</dt> <dd>This section displays graphs to show statistics for CPU, memory, diff --git a/ui/pages/tabs/host.html.tmpl b/ui/pages/tabs/host.html.tmpl index 8641962..57c7cee 100644 --- a/ui/pages/tabs/host.html.tmpl +++ b/ui/pages/tabs/host.html.tmpl @@ -75,6 +75,10 @@ <div class="section-value">{cpu}</div> </div> <div class="section-row"> + <div class="section-label">$_("CPU(s)")</div> + <div class="section-value">{num_cpu}</div> + </div> + <div class="section-row"> <div class="section-label">$_("Memory")</div> <div class="section-value">{memory}</div> </div>

Christy, psutil.NUM_CPUS reflect the **online** (as described on commit message and documentation) cores. This is the same number that the host OS recognize to all operations, that means, the same number of available cores on /proc/cpu_info and the same number of the command "ppc64_cpu --cores-on". This patch goal is provide to user the information of how many available cores the host system has at runtime. I still support this patch to reflect this new information. Regards, -- Paulo Ricardo Paz Vital <pvital@linux.vnet.ibm.com> IBM Linux Technology Center On Tue, 2014-10-28 at 13:39 -0500, Christy Perez wrote:
On Power, this doesn't seem to reflect the real number of cores.
print psutil.NUM_CPUS 14
So are we going for CPUs (and let the user figure out how many virtual CPUs he/she can consoume), or cores (which I think is more useful)?
For SMT/hyperthreading , I'm using ppc64_cpu and virsh capabilities:
<capabilities>
<host> <uuid>412bb869-1795-46e9-9bb3-dfe12f3bb45d</uuid> <cpu> <arch>x86_64</arch> <model>SandyBridge</model> <vendor>Intel</vendor> <topology sockets='1' cores='2' threads='2'/>
$ ppc64_cpu --cores-on
On 10/27/2014 03:45 PM, Paulo Vital wrote:
Support to provide the information of the number of online CPUs present in the Host system.
Also, updated English help page to express the new information.
Signed-off-by: Paulo Vital <pvital@linux.vnet.ibm.com> --- src/kimchi/model/host.py | 1 + ui/pages/help/en_US/host.dita | 4 ++-- ui/pages/tabs/host.html.tmpl | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/kimchi/model/host.py b/src/kimchi/model/host.py index 1bc3ca2..ca197c1 100644 --- a/src/kimchi/model/host.py +++ b/src/kimchi/model/host.py @@ -89,6 +89,7 @@ class HostModel(object): res['cpu'] = line.split(':')[1].strip() break
+ res['num_cpu'] = psutil.NUM_CPUS res['memory'] = psutil.TOTAL_PHYMEM
# Include IBM PowerKVM name to supported distro names diff --git a/ui/pages/help/en_US/host.dita b/ui/pages/help/en_US/host.dita index 335c51c..0dcb670 100644 --- a/ui/pages/help/en_US/host.dita +++ b/ui/pages/help/en_US/host.dita @@ -24,8 +24,8 @@ to the host system, if it is not already connected.</li> <dlentry> <dt>Basic information</dt> <dd>This section displays the host operating system distribution, -version, and code name, as well as the processor type and amount of -memory in GB.</dd> +version, and code name, as well as the processor type, the number of +online CPUs and amount of memory in GB.</dd> </dlentry><dlentry> <dt>System statistics</dt> <dd>This section displays graphs to show statistics for CPU, memory, diff --git a/ui/pages/tabs/host.html.tmpl b/ui/pages/tabs/host.html.tmpl index 8641962..57c7cee 100644 --- a/ui/pages/tabs/host.html.tmpl +++ b/ui/pages/tabs/host.html.tmpl @@ -75,6 +75,10 @@ <div class="section-value">{cpu}</div> </div> <div class="section-row"> + <div class="section-label">$_("CPU(s)")</div> + <div class="section-value">{num_cpu}</div> + </div> + <div class="section-row"> <div class="section-label">$_("Memory")</div> <div class="section-value">{memory}</div> </div>
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel

On 10/29/2014 05:53 AM, Paulo Ricardo Paz Vital wrote:
Christy,
psutil.NUM_CPUS reflect the **online** (as described on commit message and documentation) cores. This is the same number that the host OS recognize to all operations, that means, the same number of available cores on /proc/cpu_info and the same number of the command "ppc64_cpu --cores-on".
This patch goal is provide to user the information of how many available cores the host system has at runtime. I still support this patch to reflect this new information.
Disregard this e-mail. I thought I was getting different numbers on the system I checked, but, I must have been tired. This patch is fine. Regards - Christy
Regards, -- Paulo Ricardo Paz Vital <pvital@linux.vnet.ibm.com> IBM Linux Technology Center On Tue, 2014-10-28 at 13:39 -0500, Christy Perez wrote:
On Power, this doesn't seem to reflect the real number of cores.
>>> print psutil.NUM_CPUS 14
So are we going for CPUs (and let the user figure out how many virtual CPUs he/she can consoume), or cores (which I think is more useful)?
For SMT/hyperthreading , I'm using ppc64_cpu and virsh capabilities:
<capabilities>
<host> <uuid>412bb869-1795-46e9-9bb3-dfe12f3bb45d</uuid> <cpu> <arch>x86_64</arch> <model>SandyBridge</model> <vendor>Intel</vendor> <topology sockets='1' cores='2' threads='2'/>
$ ppc64_cpu --cores-on
On 10/27/2014 03:45 PM, Paulo Vital wrote:
Support to provide the information of the number of online CPUs present in the Host system.
Also, updated English help page to express the new information.
Signed-off-by: Paulo Vital <pvital@linux.vnet.ibm.com> --- src/kimchi/model/host.py | 1 + ui/pages/help/en_US/host.dita | 4 ++-- ui/pages/tabs/host.html.tmpl | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/kimchi/model/host.py b/src/kimchi/model/host.py index 1bc3ca2..ca197c1 100644 --- a/src/kimchi/model/host.py +++ b/src/kimchi/model/host.py @@ -89,6 +89,7 @@ class HostModel(object): res['cpu'] = line.split(':')[1].strip() break
+ res['num_cpu'] = psutil.NUM_CPUS res['memory'] = psutil.TOTAL_PHYMEM
# Include IBM PowerKVM name to supported distro names diff --git a/ui/pages/help/en_US/host.dita b/ui/pages/help/en_US/host.dita index 335c51c..0dcb670 100644 --- a/ui/pages/help/en_US/host.dita +++ b/ui/pages/help/en_US/host.dita @@ -24,8 +24,8 @@ to the host system, if it is not already connected.</li> <dlentry> <dt>Basic information</dt> <dd>This section displays the host operating system distribution, -version, and code name, as well as the processor type and amount of -memory in GB.</dd> +version, and code name, as well as the processor type, the number of +online CPUs and amount of memory in GB.</dd> </dlentry><dlentry> <dt>System statistics</dt> <dd>This section displays graphs to show statistics for CPU, memory, diff --git a/ui/pages/tabs/host.html.tmpl b/ui/pages/tabs/host.html.tmpl index 8641962..57c7cee 100644 --- a/ui/pages/tabs/host.html.tmpl +++ b/ui/pages/tabs/host.html.tmpl @@ -75,6 +75,10 @@ <div class="section-value">{cpu}</div> </div> <div class="section-row"> + <div class="section-label">$_("CPU(s)")</div> + <div class="section-value">{num_cpu}</div> + </div> + <div class="section-row"> <div class="section-label">$_("Memory")</div> <div class="section-value">{memory}</div> </div>
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel

Reviewed-by: Crístian Viana <vianac@linux.vnet.ibm.com> On 27-10-2014 18:45, Paulo Vital wrote:
Support to provide the information of the number of online CPUs present in the Host system.
Also, updated English help page to express the new information.
Signed-off-by: Paulo Vital <pvital@linux.vnet.ibm.com>

I suggest to use "cpus" instead of "num_cpu" And you just need to update the doc (API.md) and mockmodel.py to reflect this change On 10/27/2014 06:45 PM, Paulo Vital wrote:
Support to provide the information of the number of online CPUs present in the Host system.
Also, updated English help page to express the new information.
Signed-off-by: Paulo Vital <pvital@linux.vnet.ibm.com> --- src/kimchi/model/host.py | 1 + ui/pages/help/en_US/host.dita | 4 ++-- ui/pages/tabs/host.html.tmpl | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/kimchi/model/host.py b/src/kimchi/model/host.py index 1bc3ca2..ca197c1 100644 --- a/src/kimchi/model/host.py +++ b/src/kimchi/model/host.py @@ -89,6 +89,7 @@ class HostModel(object): res['cpu'] = line.split(':')[1].strip() break
+ res['num_cpu'] = psutil.NUM_CPUS res['memory'] = psutil.TOTAL_PHYMEM
# Include IBM PowerKVM name to supported distro names diff --git a/ui/pages/help/en_US/host.dita b/ui/pages/help/en_US/host.dita index 335c51c..0dcb670 100644 --- a/ui/pages/help/en_US/host.dita +++ b/ui/pages/help/en_US/host.dita @@ -24,8 +24,8 @@ to the host system, if it is not already connected.</li> <dlentry> <dt>Basic information</dt> <dd>This section displays the host operating system distribution, -version, and code name, as well as the processor type and amount of -memory in GB.</dd> +version, and code name, as well as the processor type, the number of +online CPUs and amount of memory in GB.</dd> </dlentry><dlentry> <dt>System statistics</dt> <dd>This section displays graphs to show statistics for CPU, memory, diff --git a/ui/pages/tabs/host.html.tmpl b/ui/pages/tabs/host.html.tmpl index 8641962..57c7cee 100644 --- a/ui/pages/tabs/host.html.tmpl +++ b/ui/pages/tabs/host.html.tmpl @@ -75,6 +75,10 @@ <div class="section-value">{cpu}</div> </div> <div class="section-row"> + <div class="section-label">$_("CPU(s)")</div> + <div class="section-value">{num_cpu}</div> + </div> + <div class="section-row"> <div class="section-label">$_("Memory")</div> <div class="section-value">{memory}</div> </div>

On Wed, 2014-10-29 at 13:51 -0200, Aline Manera wrote:
I suggest to use "cpus" instead of "num_cpu"
OK
And you just need to update the doc (API.md) and mockmodel.py to reflect this change
What?!?! The mockmodel.py still exist? I thought it was deprecated :-D Ok, will update this parts and send again a new patch. Paulo
On 10/27/2014 06:45 PM, Paulo Vital wrote:
Support to provide the information of the number of online CPUs present in the Host system.
Also, updated English help page to express the new information.
Signed-off-by: Paulo Vital <pvital@linux.vnet.ibm.com> --- src/kimchi/model/host.py | 1 + ui/pages/help/en_US/host.dita | 4 ++-- ui/pages/tabs/host.html.tmpl | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/kimchi/model/host.py b/src/kimchi/model/host.py index 1bc3ca2..ca197c1 100644 --- a/src/kimchi/model/host.py +++ b/src/kimchi/model/host.py @@ -89,6 +89,7 @@ class HostModel(object): res['cpu'] = line.split(':')[1].strip() break
+ res['num_cpu'] = psutil.NUM_CPUS res['memory'] = psutil.TOTAL_PHYMEM
# Include IBM PowerKVM name to supported distro names diff --git a/ui/pages/help/en_US/host.dita b/ui/pages/help/en_US/host.dita index 335c51c..0dcb670 100644 --- a/ui/pages/help/en_US/host.dita +++ b/ui/pages/help/en_US/host.dita @@ -24,8 +24,8 @@ to the host system, if it is not already connected.</li> <dlentry> <dt>Basic information</dt> <dd>This section displays the host operating system distribution, -version, and code name, as well as the processor type and amount of -memory in GB.</dd> +version, and code name, as well as the processor type, the number of +online CPUs and amount of memory in GB.</dd> </dlentry><dlentry> <dt>System statistics</dt> <dd>This section displays graphs to show statistics for CPU, memory, diff --git a/ui/pages/tabs/host.html.tmpl b/ui/pages/tabs/host.html.tmpl index 8641962..57c7cee 100644 --- a/ui/pages/tabs/host.html.tmpl +++ b/ui/pages/tabs/host.html.tmpl @@ -75,6 +75,10 @@ <div class="section-value">{cpu}</div> </div> <div class="section-row"> + <div class="section-label">$_("CPU(s)")</div> + <div class="section-value">{num_cpu}</div> + </div> + <div class="section-row"> <div class="section-label">$_("Memory")</div> <div class="section-value">{memory}</div> </div>

On Wed, 2014-10-29 at 13:51 -0200, Aline Manera wrote:
I suggest to use "cpus" instead of "num_cpu"
OK
And you just need to update the doc (API.md) and mockmodel.py to reflect this change
What?!?! The mockmodel.py still exist? I thought it was deprecated :-D Ok, will update this parts and send again a new patch. Paulo
On 10/27/2014 06:45 PM, Paulo Vital wrote:
Support to provide the information of the number of online CPUs present in the Host system.
Also, updated English help page to express the new information.
Signed-off-by: Paulo Vital <pvital@linux.vnet.ibm.com> --- src/kimchi/model/host.py | 1 + ui/pages/help/en_US/host.dita | 4 ++-- ui/pages/tabs/host.html.tmpl | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/kimchi/model/host.py b/src/kimchi/model/host.py index 1bc3ca2..ca197c1 100644 --- a/src/kimchi/model/host.py +++ b/src/kimchi/model/host.py @@ -89,6 +89,7 @@ class HostModel(object): res['cpu'] = line.split(':')[1].strip() break
+ res['num_cpu'] = psutil.NUM_CPUS res['memory'] = psutil.TOTAL_PHYMEM
# Include IBM PowerKVM name to supported distro names diff --git a/ui/pages/help/en_US/host.dita b/ui/pages/help/en_US/host.dita index 335c51c..0dcb670 100644 --- a/ui/pages/help/en_US/host.dita +++ b/ui/pages/help/en_US/host.dita @@ -24,8 +24,8 @@ to the host system, if it is not already connected.</li> <dlentry> <dt>Basic information</dt> <dd>This section displays the host operating system distribution, -version, and code name, as well as the processor type and amount of -memory in GB.</dd> +version, and code name, as well as the processor type, the number of +online CPUs and amount of memory in GB.</dd> </dlentry><dlentry> <dt>System statistics</dt> <dd>This section displays graphs to show statistics for CPU, memory, diff --git a/ui/pages/tabs/host.html.tmpl b/ui/pages/tabs/host.html.tmpl index 8641962..57c7cee 100644 --- a/ui/pages/tabs/host.html.tmpl +++ b/ui/pages/tabs/host.html.tmpl @@ -75,6 +75,10 @@ <div class="section-value">{cpu}</div> </div> <div class="section-row"> + <div class="section-label">$_("CPU(s)")</div> + <div class="section-value">{num_cpu}</div> + </div> + <div class="section-row"> <div class="section-label">$_("Memory")</div> <div class="section-value">{memory}</div> </div>
participants (6)
-
Aline Manera
-
Christy Perez
-
Crístian Viana
-
Daniel H Barboza
-
Paulo Ricardo Paz Vital
-
Paulo Vital