Francesco Romani has posted comments on this change.

Change subject: sampling: vm: use bulk-stats-style sample format
......................................................................


Patch Set 2: Code-Review-1

(3 comments)

needs a bit of polising

http://gerrit.ovirt.org/#/c/36731/2/vdsm/virt/vm.py
File vdsm/virt/vm.py:

Line 773:                 return idx
Line 774:     return None
Line 775: 
Line 776: 
Line 777: def _translateNetSample(oldInfo):
let's move this code into sampling.py
Line 778:     newInfo = {'net.count': len(oldInfo)}
Line 779:     for idx, (name, values) in enumerate(oldInfo.iteritems()):
Line 780:         newInfo['net.%d.name' % idx] = name
Line 781:         newInfo['net.%d.rx.bytes' % (idx)] = values[0]


Line 788:         newInfo['net.%d.tx.drop' % (idx)] = values[7]
Line 789:     return newInfo
Line 790: 
Line 791: 
Line 792: def _translateDiskSample(oldInfo):
same
Line 793:     newInfo = {'block.count': len(oldInfo)}
Line 794:     for idx, (name values) in enumerate(oldInfo.iteritems()):
Line 795:         newInfo['block.%d.name' % idx] = name
Line 796:         newInfo['block.%d.rd.times' % idx] = values['rd_total_times']


Line 803:         newInfo['block.%d.wr.bytes' % idx] = values['wr_bytes']
Line 804:     return newInfo
Line 805: 
Line 806: 
Line 807: def _translateVcpuSample(oldInfo):
same
Line 808:     newInfo = {'vcpu.current': len(oldInfo)}
Line 809:     vcpuMax = 0
Line 810:     for (vcpuNum, vcpuState, vcpuTime, pcpuNum) in oldInfo:
Line 811:         vcpuMax = max(vcpuMax, vcpuNum)


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic43b1ecb5e3503f22d3b45576310a169de852b47
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <from...@redhat.com>
Gerrit-Reviewer: Francesco Romani <from...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to