Martin Sivák has posted comments on this change.

Change subject: Adding support in CPU monitoring
......................................................................


Patch Set 1: Code-Review-1

(8 comments)

Set your IDE to it squashes extra whitespace characters and replaces tabs with 
spaces please.

http://gerrit.ovirt.org/#/c/27240/1/mom/Collectors/Collector.py
File mom/Collectors/Collector.py:

Line 137:     if m:
Line 138:         return int(m.group(1))
Line 139:     else:
Line 140:         return None
Line 141:     
whitespace
Line 142: def count_int(regex, src):
Line 143:     """
Line 144:     Parse a body of text according to the provided regular expression 
and return
Line 145:     the count of matches as an integer.


http://gerrit.ovirt.org/#/c/27240/1/mom/Collectors/GuestCpuTune.py
File mom/Collectors/GuestCpuTune.py:

Line 37:     def collect(self):
Line 38:         stat = self.hypervisor_iface.getUserVmCpuTuneInfo(self.uuid)
Line 39:         stat.update(self.hypervisor_iface.getVmCpuTuneInfo(self.uuid))
Line 40:         stat['vcpu_count'] = self.hypervisor_iface.getVmCpuCount
Line 41:         if stat == None:
If stat is None then the update line will crash
Line 42:             self.stats_error('getVmCpuTuneInfo() is not ready')
Line 43:         else:
Line 44:             self.cpu_tune_info_available = True
Line 45: 


http://gerrit.ovirt.org/#/c/27240/1/mom/Collectors/HostCpu.py
File mom/Collectors/HostCpu.py:

Line 13: 
Line 14: from mom.Collectors.Collector import *
Line 15: 
Line 16: class HostCpu(Collector):
Line 17:     
whitespaces
Line 18:     
Line 19:     def __init__(self, properties):
Line 20:         self.cpuinfo = open_datafile("/proc/cpuinfo")
Line 21: 


Line 27:         self.cpuinfo.seek(0)
Line 28: 
Line 29:         contents = self.cpuinfo.read()
Line 30:         cpu_count = count_int("^processor.*:.*", contents)
Line 31:                 
whitespaces
Line 32:         data = { 'cpu_count': cpu_count }
Line 33:         return data
Line 34: 
Line 35:     def getFields(self=None):


http://gerrit.ovirt.org/#/c/27240/1/mom/Controllers/CpuTune.py
File mom/Controllers/CpuTune.py:

Line 14: import logging
Line 15: 
Line 16: class CpuTune:
Line 17:     """
Line 18:     Simple Balloon Controller that uses the hypervisor interface to 
resize
Update the docstring please. It still references the Balloon controller
Line 19:     a guest's memory balloon.  Output triggers are:
Line 20:         - balloon_target - Set guest balloon to this size (kB)
Line 21:     """
Line 22:     def __init__(self, properties):


http://gerrit.ovirt.org/#/c/27240/1/mom/HypervisorInterfaces/libvirtInterface.py
File mom/HypervisorInterfaces/libvirtInterface.py:

Line 247: 
Line 248:     def getUserVmCpuTuneInfo(self, uuid):
Line 249:         ret = {}
Line 250:         domain = self._getDomainFromUUID(uuid)
Line 251:         
whitespaces (all over the file)
Line 252:         metadataCpuLimit = 
domain.getMetadata(2,'http://ovirt.org/param/vcpu_limit',0)
Line 253:         
Line 254:         if metadataCpuLimit:
Line 255:             ret['user_vcpu_limit'] = metadataCpuLimit


Line 253:         
Line 254:         if metadataCpuLimit:
Line 255:             ret['user_vcpu_limit'] = metadataCpuLimit
Line 256:         else: 
Line 257:             ret['user_vcpu_quota'] = 100
shouldn't the else part set the limit to 100 instead of quota?
Line 258:              
Line 259:         return ret
Line 260:     
Line 261:     def getVmCpuTuneInfo(self, uuid):


http://gerrit.ovirt.org/#/c/27240/1/mom/HypervisorInterfaces/vdsmInterface.py
File mom/HypervisorInterfaces/vdsmInterface.py:

Line 163:         except vdsmException, e:
Line 164:             e.handle_exception()
Line 165: 
Line 166:     def getUserVmCpuTuneInfo(self, uuid):
Line 167:         try:            
whitespaces again..
Line 168:             vm = API.VM(uuid)
Line 169:             response = vm.getStats()
Line 170:             self._check_status(response)
Line 171:             cpu_tune_info = 
response['statsList'][0]['userCpuTuneInfo']


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I31428499ae7b34cafa3eacf5ca0d7a39eabe23ec
Gerrit-PatchSet: 1
Gerrit-Project: mom
Gerrit-Branch: master
Gerrit-Owner: Kobi Ianko <[email protected]>
Gerrit-Reviewer: Martin Sivák <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to