GabrielBrascher commented on a change in pull request #3078: Add influxdb to
statscollector
URL: https://github.com/apache/cloudstack/pull/3078#discussion_r239786751
##########
File path: server/src/main/java/com/cloud/server/StatsCollector.java
##########
@@ -692,64 +734,62 @@ public void
doInTransactionWithoutResult(TransactionStatus status) {
if ((volumes == null) || (volumes.size()
== 0))
break;
VolumeVO volume = volumes.get(0);
- VmDiskStatisticsVO previousVmDiskStats =
-
_vmDiskStatsDao.findBy(userVm.getAccountId(), userVm.getDataCenterId(), vmId,
volume.getId());
+ VmDiskStatisticsVO previousVmDiskStats =
_vmDiskStatsDao.findBy(userVm.getAccountId(), userVm.getDataCenterId(), vmId,
volume.getId());
VmDiskStatisticsVO vmDiskStat_lock =
_vmDiskStatsDao.lock(userVm.getAccountId(), userVm.getDataCenterId(), vmId,
volume.getId());
- if ((vmDiskStat.getBytesRead() == 0) &&
(vmDiskStat.getBytesWrite() == 0) && (vmDiskStat.getIORead() == 0) &&
- (vmDiskStat.getIOWrite() == 0)) {
+ if ((vmDiskStat.getBytesRead() == 0) &&
(vmDiskStat.getBytesWrite() == 0) && (vmDiskStat.getIORead() == 0) &&
(vmDiskStat.getIOWrite() == 0)) {
s_logger.debug("IO/bytes read and
write are all 0. Not updating vm_disk_statistics");
continue;
}
if (vmDiskStat_lock == null) {
- s_logger.warn("unable to find vm disk
stats from host for account: " + userVm.getAccountId() + " with vmId: " +
userVm.getId() +
- " and volumeId:" +
volume.getId());
+ s_logger.warn("unable to find vm disk
stats from host for account: " + userVm.getAccountId() + " with vmId: " +
userVm.getId()
+ + " and volumeId:" +
volume.getId());
continue;
}
- if (previousVmDiskStats != null &&
-
((previousVmDiskStats.getCurrentBytesRead() !=
vmDiskStat_lock.getCurrentBytesRead()) ||
-
(previousVmDiskStats.getCurrentBytesWrite() !=
vmDiskStat_lock.getCurrentBytesWrite()) ||
-
(previousVmDiskStats.getCurrentIORead() != vmDiskStat_lock.getCurrentIORead())
|| (previousVmDiskStats.getCurrentIOWrite() !=
vmDiskStat_lock.getCurrentIOWrite()))) {
- s_logger.debug("vm disk stats changed
from the time GetVmDiskStatsCommand was sent. " + "Ignoring current answer.
Host: " +
- host.getName() + " . VM: " +
vmDiskStat.getVmName() + " Read(Bytes): " + vmDiskStat.getBytesRead() + "
write(Bytes): " +
- vmDiskStat.getBytesWrite() + "
Read(IO): " + vmDiskStat.getIORead() + " write(IO): " +
vmDiskStat.getIOWrite());
+ if (previousVmDiskStats != null &&
((previousVmDiskStats.getCurrentBytesRead() !=
vmDiskStat_lock.getCurrentBytesRead())
Review comment:
Fixed, thanks.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services