Bug 1505328

Summary: [Rest] - Rest should report current rx/tx data in bps
Product: [oVirt] ovirt-engine Reporter: Michael Burman <mburman>
Component: BLL.NetworkAssignee: Ales Musil <amusil>
Status: CLOSED CURRENTRELEASE QA Contact: Michael Burman <mburman>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.1.7.4CC: amusil, bugs, danken, mburman, mjankula
Target Milestone: ovirt-4.2.0Flags: rule-engine: ovirt-4.2+
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-12-20 10:54:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Network RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Michael Burman 2017-10-23 10:55:27 UTC
Description of problem:
[Rest] - Wrong current rx/tx rate reported in the Rest API.

Rest API display wrong values for the current rx/tx rates. For example, i'm running iperf between 2 physical hosts, the tx rate is  984Mbps, UI shows 984 and report correct value, but rest api shows - 120000000 in bytes per second, which means after converting - 120 megabyte per second.

<name>data.current.tx</name>
<description>Transmit data rate</description>
<kind>gauge</kind>
<type>decimal</type>
<unit>bytes_per_second</unit>
<values>
<value>
<datum>120000000</datum>
</value>
</values>

- Please note that only the current tx/rx values are wrong, the 'total' tx/rx seems to be OK.

Version-Release number of selected component (if applicable):
4.1.7.4-0.1.el7
4.2.0-0.0.master.20171022103432.gitaf9d8b6.el7.centos

How reproducible:
100%

Steps to Reproduce:
1. Run iperf between 2 physical hosts
2. Check the current tx rate reported in the UI and in rest API

Actual results:
Rest API shows wrong current tx/rx values.
UI shows correct values.

Expected results:
Rest should show correct values. Looks like rest has a limit of 120000000 bytes per second.

Comment 1 Ales Musil 2017-10-27 11:04:39 UTC
I have checked it and it seems like everything is correct. In your case REST is reporting 120000000Bps which is 960Mbps (converting Bytes to Bits). That means difference about ~25Mbps. This difference is caused by slight delay. REST has newer values than UI. 

It's true that it is confusing both UI and REST should report their values in either bps or Bps. We can change the REST values to bps, what do you think?

Comment 2 Michael Burman 2017-10-29 06:45:22 UTC
Ok i see now, REST report 120000000Bps which is:
120 - megabyte per second (MB/s)
960 - megabit per second (Mbps)	,
and from here is the whole confusion, Bytes vs Bits. 
I agree this is extremely confusing, i think that REST should report bps indeed in order to avoid such confusion, specially if the UI report in Mbps.

Comment 3 Dan Kenigsberg 2017-10-30 09:41:14 UTC
I agree that <unit>bits_per_second</unit> would be better.

Comment 4 Ales Musil 2017-11-09 08:10:12 UTC
We cannot change the units of data.current.tx/rx but we have added new value which is data.current.tx/rx.bps in bit per second.

Comment 5 Michael Burman 2017-11-09 09:42:58 UTC
Verified on - 4.2.0-0.0.master.20171108151837.gita7de53e.el7.centos

Rest now report both data.current.tx/rx and data.current.tx/rx.bps which make it much more easier to understand what is actually reported in the rest.

<name>data.current.rx</name>
<description>Receive data rate</description>
<kind>gauge</kind>
<type>decimal</type>
<unit>bytes_per_second</unit>
<values>
<value>
<datum>120000000</datum>
</value>
</values>

<name>data.current.rx.bps</name>
<description>Receive data rate</description>
<kind>gauge</kind>
<type>decimal</type>
<unit>bits_per_second</unit>
<values>
<value>
<datum>960000000</datum>
</value>
</values>

<name>data.current.tx</name>
<description>Transmit data rate</description>
<kind>gauge</kind>
<type>decimal</type>
<unit>bytes_per_second</unit>
<values>
<value>
<datum>830000</datum>
</value>
</values>

<name>data.current.tx.bps</name>
<description>Transmit data rate</description>
<kind>gauge</kind>
<type>decimal</type>
<unit>bits_per_second</unit>
<values>
<value>
<datum>6600000</datum>
</value>
</values>

Comment 6 Marian Jankular 2017-11-16 08:54:22 UTC
Hello,

can we back-port this into next z stream release? 

Marian

Comment 7 Ales Musil 2017-11-16 14:12:52 UTC
Hello,

we can backport it, but I am not sure if it related to the customer case. The bug name might be misleading a bit. There is no actual bug. We have added reporting in bps to prevent confusion in differences between REST and UI.

Hopefully this explanation will help you. 

Ales

Comment 8 Sandro Bonazzola 2017-12-20 10:54:14 UTC
This bugzilla is included in oVirt 4.2.0 release, published on Dec 20th 2017.

Since the problem described in this bug report should be
resolved in oVirt 4.2.0 release, published on Dec 20th 2017, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.