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/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIMessages.java M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/host/SubTabHostHardwareView.java 5 files changed, 29 insertions(+), 5 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/16/35316/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 6932b2e..9855790 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 @@ -24,6 +24,7 @@ private ArrayList<VdsNetworkInterface> mInterfaceList; private ArrayList<Network> mNetworkList; private String activeNic; + private boolean countThreadsAsCores; /** * This map holds the disk usage reported by the host. The mapping is path to usage (in MB). @@ -64,6 +65,7 @@ result = prime * result + ((vdsGroupName == null) ? 0 : vdsGroupName.hashCode()); result = prime * result + ((vdsGroupVirtService == null) ? 0 : vdsGroupVirtService.hashCode()); result = prime * result + ((vdsGroupGlusterService == null) ? 0 : vdsGroupGlusterService.hashCode()); + result = prime * result + (countThreadsAsCores ? 0 : 1); return result; } @@ -1431,4 +1433,13 @@ public boolean getLiveMergeSupport() { return this.mVdsDynamic.getLiveMergeSupport(); } + + 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 f70031e..33bfe6a 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 @@ -372,6 +372,7 @@ entity.setNumaSupport(rs.getBoolean("is_numa_supported")); entity.setLiveSnapshotSupport(rs.getBoolean("is_live_snapshot_supported")); entity.setLiveMergeSupport(rs.getBoolean("is_live_merge_supported")); + 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..db33489 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,14 +173,14 @@ } } - 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; @@ -252,7 +252,16 @@ setNumberOfSockets(vds.getCpuSockets()); if (vds.getCpuCores() != null && vds.getCpuSockets() != null && vds.getCpuSockets() != 0) { - setCoresPerSocket(vds.getCpuCores() / vds.getCpuSockets()); + int coresPerSocket = vds.getCpuCores() / vds.getCpuSockets(); + + + String fieldValue = String.valueOf(coresPerSocket); + if (vds.getCountThreadsAsCores()) { + fieldValue = ConstantsManager.getInstance().getMessages() + .threadsAsCoresPerSocket(coresPerSocket, vds.getCpuThreads()); + } + + setCoresPerSocket(fieldValue); } else { setCoresPerSocket(null); } diff --git a/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIMessages.java b/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIMessages.java index a579942..93b46fd 100644 --- a/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIMessages.java +++ b/frontend/webadmin/modules/uicompat/src/main/java/org/ovirt/engine/ui/uicompat/UIMessages.java @@ -403,4 +403,7 @@ @DefaultMessage("Default ({0})") String defaultMtu(int mtu); + + @DefaultMessage("{0} ({1})") + String threadsAsCoresPerSocket(int cores, int threads); } 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 fa365f7..6892cfd 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 @@ -46,7 +46,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/35316 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2fb9d28f3b125a9104fec5f3a887efdbf711b037 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: ovirt-engine-3.5 Gerrit-Owner: Jiří Moskovčák <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
