Liron Ar has posted comments on this change.

Change subject: core: disk_image_dynamic statistics (#892596)
......................................................................


Patch Set 4: (4 inline comments)

....................................................
File 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsUpdateRunTimeInfo.java
Line 1702:             addVmStatisticsToList(vmToUpdate.getStatisticsData());
Line 1703:             updateInterfaceStatistics(vmToUpdate, vmStatistics);
Line 1704: 
Line 1705:             for (DiskImageDynamic imageDynamic : 
_runningVms.get(vmToUpdate.getId()).getVmDynamic().getDisks()) {
Line 1706:                 Disk disk = 
getDbFacade().getDiskDao().get(imageDynamic.getId());
this adds a lot of db loads - I'd prefer that we avoid it..
Line 1707:                 // We have disk_id statistics, which is good, but 
disk_image_dynamic table contains image_id, so we
Line 1708:                 // update for the AI.
Line 1709:                 if (disk instanceof DiskImage) {
Line 1710:                     DiskImage diskImage = (DiskImage) disk;


Line 1705:             for (DiskImageDynamic imageDynamic : 
_runningVms.get(vmToUpdate.getId()).getVmDynamic().getDisks()) {
Line 1706:                 Disk disk = 
getDbFacade().getDiskDao().get(imageDynamic.getId());
Line 1707:                 // We have disk_id statistics, which is good, but 
disk_image_dynamic table contains image_id, so we
Line 1708:                 // update for the AI.
Line 1709:                 if (disk instanceof DiskImage) {
perhaps use disk.getType instead.
Line 1710:                     DiskImage diskImage = (DiskImage) disk;
Line 1711:                     Guid ActiveImageId = diskImage.getImageId();
Line 1712:                     imageDynamic.setId(ActiveImageId);
Line 1713:                     _vmDiskImageDynamicToSave.put(ActiveImageId, 
imageDynamic);


Line 1707:                 // We have disk_id statistics, which is good, but 
disk_image_dynamic table contains image_id, so we
Line 1708:                 // update for the AI.
Line 1709:                 if (disk instanceof DiskImage) {
Line 1710:                     DiskImage diskImage = (DiskImage) disk;
Line 1711:                     Guid ActiveImageId = diskImage.getImageId();
please remove the "A" from the name
Line 1712:                     imageDynamic.setId(ActiveImageId);
Line 1713:                     _vmDiskImageDynamicToSave.put(ActiveImageId, 
imageDynamic);
Line 1714:                 }
Line 1715:             }


Line 1708:                 // update for the AI.
Line 1709:                 if (disk instanceof DiskImage) {
Line 1710:                     DiskImage diskImage = (DiskImage) disk;
Line 1711:                     Guid ActiveImageId = diskImage.getImageId();
Line 1712:                     imageDynamic.setId(ActiveImageId);
I'd prefer to avoid it - I'd suggest to do it the db (will avoid the queries as 
well) or make changes in the db so that won't be neccessary.
Line 1713:                     _vmDiskImageDynamicToSave.put(ActiveImageId, 
imageDynamic);
Line 1714:                 }
Line 1715:             }
Line 1716:         }


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I9f49238e3a725184ad2feb2d5ff06996e462d377
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Vered Volansky <[email protected]>
Gerrit-Reviewer: Alissa Bonas <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Liron Ar <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Vered Volansky <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to