Alona Kaplan has uploaded a new change for review.

Change subject: restapi: Units for statistics of host NICs should be 
MEGABYTES_PER_SECOND
......................................................................

restapi: Units for statistics of host NICs should be MEGABYTES_PER_SECOND

Units for statistics of host NICs are wrong.
It is BYTES_PER_SECOND should be MEGABYTES_PER_SECOND.

Change-Id: Ia5b3e42dca9ffb1593c90285cfbf3d8cd36fef81
Bug-Url: https://bugzilla.redhat.com/887230
Signed-off-by: Alona Kaplan <alkap...@redhat.com>
---
M 
backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
M 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/AbstractStatisticalQuery.java
M 
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/HostNicStatisticalQuery.java
3 files changed, 5 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/80/11980/1

diff --git 
a/backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
 
b/backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
index 5d1b32e..5ad7f9d 100644
--- 
a/backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
+++ 
b/backend/manager/modules/restapi/interface/definition/src/main/resources/api.xsd
@@ -333,6 +333,7 @@
       <xs:enumeration value="BYTES_PER_SECOND"/>
       <xs:enumeration value="BITS_PER_SECOND"/>
       <xs:enumeration value="COUNT_PER_SECOND"/>
+      <xs:enumeration value="MEGABYTES_PER_SECOND"/>
     </xs:restriction>
   </xs:simpleType>
 
diff --git 
a/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/AbstractStatisticalQuery.java
 
b/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/AbstractStatisticalQuery.java
index f3ee78e..4678058 100644
--- 
a/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/AbstractStatisticalQuery.java
+++ 
b/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/AbstractStatisticalQuery.java
@@ -13,8 +13,8 @@
 import org.ovirt.engine.api.model.Value;
 import org.ovirt.engine.api.model.ValueType;
 import org.ovirt.engine.api.model.Values;
-import org.ovirt.engine.core.compat.Guid;
 import 
org.ovirt.engine.api.restapi.resource.BaseBackendResource.BackendFailureException;
+import org.ovirt.engine.core.compat.Guid;
 
 /**
  * Subclasses encapsulate the subject-specific aspects of a statistical query
@@ -29,6 +29,7 @@
     protected static final StatisticUnit PERCENT = StatisticUnit.PERCENT;
     protected static final StatisticUnit BYTES = StatisticUnit.BYTES;
     protected static final StatisticUnit BYTES_PER_SECOND = 
StatisticUnit.BYTES_PER_SECOND;
+    protected static final StatisticUnit MEGA_BYTES_PER_SECOND = 
StatisticUnit.MEGABYTES_PER_SECOND;
     protected static final StatisticUnit BITS_PER_SECOND = 
StatisticUnit.BITS_PER_SECOND;
     protected static final ValueType INTEGER = ValueType.INTEGER;
     protected static final ValueType DECIMAL = ValueType.DECIMAL;
diff --git 
a/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/HostNicStatisticalQuery.java
 
b/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/HostNicStatisticalQuery.java
index 162cc95..70d3b7b 100644
--- 
a/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/HostNicStatisticalQuery.java
+++ 
b/backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/HostNicStatisticalQuery.java
@@ -11,8 +11,8 @@
 
 public class HostNicStatisticalQuery extends AbstractStatisticalQuery<HostNIC, 
VdsNetworkInterface> {
 
-    private final static Statistic DATA_RX = create("data.current.rx", 
"Receive data rate",  GAUGE, BYTES_PER_SECOND, DECIMAL);
-    private final static Statistic DATA_TX = create("data.current.tx", 
"Transmit data rate", GAUGE, BYTES_PER_SECOND, DECIMAL);
+    private final static Statistic DATA_RX = create("data.current.rx", 
"Receive data rate",  GAUGE, MEGA_BYTES_PER_SECOND, DECIMAL);
+    private final static Statistic DATA_TX = create("data.current.tx", 
"Transmit data rate", GAUGE, MEGA_BYTES_PER_SECOND, DECIMAL);
     private final static Statistic ERRS_RX = create("errors.total.rx", "Total 
receive errors", COUNTER, NONE, INTEGER);
     private final static Statistic ERRS_TX = create("errors.total.tx", "Total 
transmit errors", COUNTER, NONE, INTEGER);
 


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia5b3e42dca9ffb1593c90285cfbf3d8cd36fef81
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alona Kaplan <alkap...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to