Jiří Moskovčák has uploaded a new change for review. Change subject: webadmin: make it more obvious that thread as cores is enabled ......................................................................
webadmin: make it more obvious that thread as cores is enabled Users are confused when the count threads as cores is enabled, but the threads per socket still shows the same value. This patch changes the UI a adds also the threads count to the "Cores per socket" field. Change-Id: I2fb9d28f3b125a9104fec5f3a887efdbf711b037 Bug-Url: https://bugzilla.redhat.com/1082681 Signed-off-by: Jiri Moskovcak <[email protected]> --- M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VDS.java M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsDAODbFacadeImpl.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostHardwareGeneralModel.java M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/host/SubTabHostHardwareView.java 5 files changed, 27 insertions(+), 7 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/85/33485/1 diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VDS.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VDS.java index 611fb83..c20784d 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VDS.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VDS.java @@ -25,6 +25,7 @@ private ArrayList<Network> mNetworkList; private String activeNic; private boolean balloonEnabled; + private boolean countThreadsAsCores; /** * This map holds the disk usage reported by the host. The mapping is path to usage (in MB). @@ -1435,4 +1436,12 @@ this.balloonEnabled = enableBalloon; } + public void setCountThreadsAsCores(boolean value) { + this.countThreadsAsCores = value; + } + + public boolean getCountThreadsAsCores() { + return countThreadsAsCores; + } + } diff --git a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsDAODbFacadeImpl.java b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsDAODbFacadeImpl.java index e235806..cd131ea 100644 --- a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsDAODbFacadeImpl.java +++ b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VdsDAODbFacadeImpl.java @@ -362,6 +362,7 @@ entity.setLiveSnapshotSupport(rs.getBoolean("is_live_snapshot_supported")); entity.setLiveMergeSupport(rs.getBoolean("is_live_merge_supported")); entity.setBalloonEnabled(rs.getBoolean("enable_balloon")); + entity.setCountThreadsAsCores(rs.getBoolean("count_threads_as_cores")); return entity; } } diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostHardwareGeneralModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostHardwareGeneralModel.java index 7c2bed5..f288bfa 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostHardwareGeneralModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostHardwareGeneralModel.java @@ -173,19 +173,19 @@ } } - private Integer coresPerSocket; + private String coresPerSocket; - public Integer getCoresPerSocket() + public String getCoresPerSocket() { return coresPerSocket; } - public void setCoresPerSocket(Integer value) + public void setCoresPerSocket(String value) { if (coresPerSocket == null && value == null) { return; } if (coresPerSocket == null || !coresPerSocket.equals(value)) { - coresPerSocket = value; + coresPerSocket = "" + value; onPropertyChanged(new PropertyChangedEventArgs("CoresPerSocket")); //$NON-NLS-1$ } } @@ -252,7 +252,18 @@ setNumberOfSockets(vds.getCpuSockets()); if (vds.getCpuCores() != null && vds.getCpuSockets() != null && vds.getCpuSockets() != 0) { - setCoresPerSocket(vds.getCpuCores() / vds.getCpuSockets()); + StringBuffer coresPerSocketBuff = new StringBuffer(); + int coresPerSocket = vds.getCpuCores() / vds.getCpuSockets(); + + coresPerSocketBuff.append(coresPerSocket); + + if (vds.getCountThreadsAsCores()) { + coresPerSocketBuff.append(" ("); //$NON-NLS-1$ + coresPerSocketBuff.append(vds.getCpuThreads()); + coresPerSocketBuff.append(")"); //$NON-NLS-1$ + } + + setCoresPerSocket(coresPerSocketBuff.toString()); } else { setCoresPerSocket(null); } diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java index 2cea001..162d4d6 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/ApplicationConstants.java @@ -787,7 +787,6 @@ " Hyper-Threading technology on the virtualization host. Enabling this option may be useful for less" + " CPU-intensive workloads, or to run guests with CPU configurations that would otherwise be restricted.") String clusterPopupCpuThreadsInfo(); - @DefaultStringValue("Count Threads As Cores") String clusterPopupCountThreadsAsCoresLabel(); diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/host/SubTabHostHardwareView.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/host/SubTabHostHardwareView.java index 38c4db4..ea39283 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/host/SubTabHostHardwareView.java +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/host/SubTabHostHardwareView.java @@ -51,7 +51,7 @@ TextBoxLabel cpuType = new TextBoxLabel(); TextBoxLabel cpuModel = new TextBoxLabel(); NullableNumberTextBoxLabel<Integer> numberOfSockets = new NullableNumberTextBoxLabel<Integer>(constants.unknown()); - NullableNumberTextBoxLabel<Integer> coresPerSocket = new NullableNumberTextBoxLabel<Integer>(constants.unknown()); + TextBoxLabel coresPerSocket = new TextBoxLabel(); TextBoxLabel threadsPerCore = new TextBoxLabel(); @UiField(provided = true) -- To view, visit http://gerrit.ovirt.org/33485 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2fb9d28f3b125a9104fec5f3a887efdbf711b037 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Jiří Moskovčák <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
