Alona Kaplan has posted comments on this change.

Change subject: engine: Persist total RX/TX in compatible hosts/VMs
......................................................................


Patch Set 8:

(4 comments)

http://gerrit.ovirt.org/#/c/36470/8/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/NetworkStatisticsBuilder.java
File 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/NetworkStatisticsBuilder.java:

Line 76:             stats.offset = offset;
Line 77:             stats.rate = null;
Line 78:         } else if (offset == null) {
Line 79:             // statistic reported for the first time - set to zero, 
set offset accordingly, and rate can't be computed
Line 80:             stats.current = 0L;
Why not-
stats.current = reported
stats.offset = 0 ?
Line 81:             stats.offset = -reported;
Line 82:             stats.rate = null;
Line 83:         } else {
Line 84:             stats.offset = offset;


http://gerrit.ovirt.org/#/c/36470/8/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VmAnalyzer.java
File 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VmAnalyzer.java:

Line 754:             // if rtl+pv it will get here 2 times (we take the max 
one)
Line 755:             if (firstTime) {
Line 756:                 
statsBuilder.updateExistingInterfaceStatistics(vmIface, ifStats);
Line 757:             } else {
Line 758:                 
vmIface.getStatistics().setReceiveRate(Math.max(vmIface.getStatistics().getReceiveRate(),
I'm not sure how can we get the same mac twice, but what about rx/txBytes and 
sample time?
Line 759:                         ifStats.getStatistics().getReceiveRate()));
Line 760:                 
vmIface.getStatistics().setReceiveDropRate(Math.max(vmIface.getStatistics().getReceiveDropRate(),
Line 761:                         
ifStats.getStatistics().getReceiveDropRate()));
Line 762:                 
vmIface.getStatistics().setTransmitRate(Math.max(vmIface.getStatistics().getTransmitRate(),


http://gerrit.ovirt.org/#/c/36470/8/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 890:     }
Line 891: 
Line 892:     private static void extractInterfaceStatistics(Map<String, 
Object> dict, NetworkInterface<?> iface) {
Line 893:         NetworkStatistics stats = iface.getStatistics();
Line 894:         
stats.setReceiveRate(assignDoubleValueWithNullProtection(dict, 
VdsProperties.rx_rate));
Shouldn't the rate extraction be done just for old versions?
Line 895:         
stats.setReceiveDropRate(assignDoubleValueWithNullProtection(dict, 
VdsProperties.rx_dropped));
Line 896:         stats.setReceivedBytes(AssignLongValue(dict, 
VdsProperties.rx_total));
Line 897:         
stats.setTransmitRate(assignDoubleValueWithNullProtection(dict, 
VdsProperties.tx_rate));
Line 898:         
stats.setTransmitDropRate(assignDoubleValueWithNullProtection(dict, 
VdsProperties.tx_dropped));


Line 893:         NetworkStatistics stats = iface.getStatistics();
Line 894:         
stats.setReceiveRate(assignDoubleValueWithNullProtection(dict, 
VdsProperties.rx_rate));
Line 895:         
stats.setReceiveDropRate(assignDoubleValueWithNullProtection(dict, 
VdsProperties.rx_dropped));
Line 896:         stats.setReceivedBytes(AssignLongValue(dict, 
VdsProperties.rx_total));
Line 897:         
stats.setTransmitRate(assignDoubleValueWithNullProtection(dict, 
VdsProperties.tx_rate));
same
Line 898:         
stats.setTransmitDropRate(assignDoubleValueWithNullProtection(dict, 
VdsProperties.tx_dropped));
Line 899:         stats.setTransmittedBytes(AssignLongValue(dict, 
VdsProperties.tx_total));
Line 900:         stats.setSampleTime(AssignDoubleValue(dict, 
VdsProperties.sample_time));
Line 901: 


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I3063bb36fb7e4d5a545d42c648091688ce1e6964
Gerrit-PatchSet: 8
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Lior Vernia <lver...@redhat.com>
Gerrit-Reviewer: Alona Kaplan <alkap...@redhat.com>
Gerrit-Reviewer: Martin Mucha <mmu...@redhat.com>
Gerrit-Reviewer: Moti Asayag <masa...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to