Lior Vernia has uploaded a new change for review. Change subject: core: Add total RX/TX bytes to NetworkStatistics ......................................................................
core: Add total RX/TX bytes to NetworkStatistics This will provide the basis for total network usage by host/VM interfaces. Change-Id: I1178faca34203b01b6fc120bf7f65ba1caf500a8 Signed-off-by: Lior Vernia <[email protected]> --- M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/network/NetworkStatistics.java 1 file changed, 84 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/67/36467/1 diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/network/NetworkStatistics.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/network/NetworkStatistics.java index bd40535..ac1bcdf 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/network/NetworkStatistics.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/network/NetworkStatistics.java @@ -18,9 +18,15 @@ private Double receiveRate; + private Long receivedBytes; + private Double transmitDropRate; private Double transmitRate; + + private Long transmittedBytes; + + private Long sampleTime; /** * Sets the instance id. @@ -101,6 +107,25 @@ } /** + * Sets the total received bytes. + * + * @param receivedBytes + * the total received bytes. + */ + public void setReceivedBytes(Long receivedBytes) { + this.receivedBytes = receivedBytes; + } + + /** + * Returns the total received bytes. + * + * @return the total received bytes. + */ + public Long getReceivedBytes() { + return receivedBytes; + } + + /** * Sets the transmitted data drop rate. * * @param transmitDropRate @@ -138,6 +163,44 @@ return transmitRate; } + /** + * Sets the total transmitted bytes. + * + * @param transmittedBytes + * the total transmitted bytes. + */ + public void setTransmittedBytes(Long transmittedBytes) { + this.transmittedBytes = transmittedBytes; + } + + /** + * Returns the total transmitted bytes. + * + * @return the total transmitted bytes. + */ + public Long getTransmittedBytes() { + return transmittedBytes; + } + + /** + * Sets the time, in seconds, of the current statistics sample. + * + * @param sampleTime + * the current sample time in seconds. + */ + public void setSampleTime(Long sampleTime) { + this.sampleTime = sampleTime; + } + + /** + * Returns the time, in seconds, of the current statistics sample. + * + * @return the current sample time in seconds. + */ + public Long getSampleTime() { + return sampleTime; + } + @Override public int hashCode() { final int prime = 31; @@ -145,9 +208,12 @@ result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); result = prime * result + ((getReceiveDropRate() == null) ? 0 : getReceiveDropRate().hashCode()); result = prime * result + ((getReceiveRate() == null) ? 0 : getReceiveRate().hashCode()); + result = prime * result + ((getReceivedBytes() == null) ? 0 : getReceivedBytes().hashCode()); result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); result = prime * result + ((getTransmitDropRate() == null) ? 0 : getTransmitDropRate().hashCode()); result = prime * result + ((getTransmitRate() == null) ? 0 : getTransmitRate().hashCode()); + result = prime * result + ((getTransmittedBytes() == null) ? 0 : getTransmittedBytes().hashCode()); + result = prime * result + ((getSampleTime() == null) ? 0 : getSampleTime().hashCode()); return result; } @@ -175,6 +241,12 @@ return false; } else if (!getReceiveRate().equals(other.getReceiveRate())) return false; + if (getReceivedBytes() == null) { + if (other.getReceivedBytes() != null) + return false; + } else if (!getReceivedBytes().equals(other.getReceivedBytes())) { + return false; + } if (getStatus() != other.getStatus()) return false; if (getTransmitDropRate() == null) { @@ -187,6 +259,18 @@ return false; } else if (!getTransmitRate().equals(other.getTransmitRate())) return false; + if (getTransmittedBytes() == null) { + if (other.getTransmittedBytes() != null) + return false; + } else if (!getTransmittedBytes().equals(other.getTransmittedBytes())) { + return false; + } + if (getSampleTime() == null) { + if (other.getSampleTime() != null) + return false; + } else if (!getSampleTime().equals(other.getSampleTime())) { + return false; + } return true; } } -- To view, visit http://gerrit.ovirt.org/36467 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1178faca34203b01b6fc120bf7f65ba1caf500a8 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Lior Vernia <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
