Michael Pasternak has posted comments on this change.
Change subject: restapi: Rx and Tx should be displayed as BYTES_PER_SECOND
......................................................................
Patch Set 1: (2 inline comments)
....................................................
File
backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/util/RxTxCalculator.java
Line 1: package org.ovirt.engine.api.restapi.util;
Line 2:
Line 3: public class RxTxCalculator {
Line 4:
Line 5: public static Double calcRxTx(Integer speedValueInMegaBits, Double
rxTxValueInPrecent) {
i'd call this method according to type of translation like percent2bytes() t
will be much more informative
Line 6: if (speedValueInMegaBits == null || rxTxValueInPrecent == null)
{
Line 7: return null;
Line 8: }
Line 9: return megaBitToByte(speedValueInMegaBits * rxTxValueInPrecent
/ 100);
....................................................
File
backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendHostNicResourceTest.java
Line 450: assertSame(entity, query.resolve(NIC_ID));
Line 451: List<Statistic> statistics = query.getStatistics(entity);
Line 452: verifyStatistics(statistics,
Line 453: new String[] { "data.current.rx", "data.current.tx",
"errors.total.rx", "errors.total.tx" },
Line 454: new BigDecimal[] { asDec(RxTxCalculator.calcRxTx(50,
10D)), asDec(RxTxCalculator.calcRxTx(50, 20D)),
i'd convert 50, 100 to constants and reuse them in all places rather than
pointing to the value manually.
Line 455: asDec(30), asDec(40) });
Line 456: Statistic adopted = query.adopt(new Statistic());
Line 457: assertTrue(adopted.isSetHostNic());
Line 458: assertEquals(NIC_ID.toString(), adopted.getHostNic().getId());
--
To view, visit http://gerrit.ovirt.org/12164
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Icb004ae50c00acbcb7aeb53fb3962028e6966fbc
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alona Kaplan <[email protected]>
Gerrit-Reviewer: Michael Pasternak <[email protected]>
Gerrit-Reviewer: Moti Asayag <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches