Moti Asayag has posted comments on this change.

Change subject: engine: Calculate "true" host network usage
......................................................................


Patch Set 1:

(3 comments)

http://gerrit.ovirt.org/#/c/31000/1/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/network/VdsNetworkInterface.java
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/network/VdsNetworkInterface.java:

Line 248:      * Checks whether an interface is a VLAN device.
Line 249:      *
Line 250:      * @return whether an interface is a VLAN device.
Line 251:      */
Line 252:     public boolean isVlanDevice() {
> NetowrkUtils.isVlan(VdsNetworkInterface nic) is used for this purpose.
This is way out-of the scope of this patch and could be done by a following 
patch. However, I'd rather to have all done on the same branch.

So perhaps this can change should be applied on the master, after using the  
NetowrkUtils.isVlan() to solve this bug in order to reduce changes on the 
stable branch.

I'd also use getVlanId() within this method instead of referring the vlanId 
member directly.
Line 253:         return vlanId != null;
Line 254:     }
Line 255: 
Line 256:     /**


http://gerrit.ovirt.org/#/c/31000/1/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsBrokerObjectsBuilder.java
File 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsBrokerObjectsBuilder.java:

Line 680:         // ------------- vds network statistics ---------------------
Line 681:         Map<String, Object> interfaces = (Map<String, Object>) 
xmlRpcStruct.get(VdsProperties.NETWORK);
Line 682:         if (interfaces != null) {
Line 683:             Map<String, VdsNetworkInterface> nicsByName = 
Entities.entitiesByName(vds.getInterfaces());
Line 684:             Set<String> usageNics = new HashSet<String>();
The type on the right side can be omitted (new HashSet<>();)
Line 685:             for (Entry<String, Object> entry : interfaces.entrySet()) 
{
Line 686:                 if (nicsByName.containsKey(entry.getKey())) {
Line 687:                     VdsNetworkInterface iface = 
nicsByName.get(entry.getKey());
Line 688:                     iface.setVdsId(vds.getId());


Line 707:             double networkUsage = 0;
Line 708:             int networkCapacity = 0;
Line 709:             for (String nicName : usageNics) {
Line 710:                 VdsNetworkInterface iface = nicsByName.get(nicName);
Line 711:                 networkUsage +=
pleas extract the network usage percentage computation into a method.
Line 712:                         iface.getSpeed()
Line 713:                                 * 
(truncatePercentage(iface.getStatistics().getReceiveRate())
Line 714:                                         + 
truncatePercentage(iface.getStatistics().getTransmitRate()));
Line 715: 


-- 
To view, visit http://gerrit.ovirt.org/31000
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I71adf32f76414fe34d433177741e73529959992b
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Lior Vernia <[email protected]>
Gerrit-Reviewer: Alona Kaplan <[email protected]>
Gerrit-Reviewer: Lior Vernia <[email protected]>
Gerrit-Reviewer: Moti Asayag <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to