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hzMS50b3RjcHUuc3lz
IC0gaHMwLnRvdGNwdS5zeXMpICUgKDIgKiogMzIpDQogICAgICAgIHN0YXRzWydjcHVTeXMnXSA9
IGppZmZpZXMgLyBpbnRlcnZhbCAvIHNlbGYuX25jcHVzDQogICAgICAgIHN0YXRzWydjcHVJZGxl
J10gPSBtYXgoMC4wLCAxMDAuMCAtIHN0YXRzWydjcHVVc2VyJ10gLSBzdGF0c1snY3B1U3lzJ10p
DQpjbGFzcyBIb3N0U2FtcGxlDQpmdW5jdGlvbiBfX2luaXRfXw0KICAgICAgICAgICAgICAgICAg
IHNlbGYudG90Y3B1ID0gVG90YWxDcHVTYW1wbGUoKQ0KY2xhc3MgVG90YWxDcHVTYW1wbGUNCmZ1
bmN0aW9uIF9faW5pdF9fDQogICAgICAgICBzZWxmLnVzZXIsIHVzZXJOaWNlLCBzZWxmLnN5cywg
c2VsZi5pZGxlID0gXA0KICAgICAgICAgICAgbWFwKGludCwgZmlsZSgnL3Byb2Mvc3RhdCcpLnJl
YWRsaW5lKCkuc3BsaXQoKVsxOjVdKQ0KICAgICAgICBzZWxmLnVzZXIgKz0gdXNlck5pY2UNCg0K
UXVlc3Rpb24xOiBXaHkgc3RhdHNboa5jcHVJZGxloa9dIGRvIG5vdCB1c2UgdGhlIHNhbXBsaW5n
IGRhdGEgdG90Y3B1LmlkbGUgZm9yIGNhbGN1bGF0aW5nPw0KDQpRdWVzdGlvbjI6IFRoZXJlIGlz
IGFub3RoZXIgZGF0YSBuYW1lZCBpb3dhaXQgaW4gL3Byb2Mvc3RhdCwgZG8gd2UgbmVlZCB0byBj
b25zaWRlciBhZGQgdGhpcyBpbnRvIHVzYWdlIENQVSBwZXJjZW50YWdlIGZvciBjYWxjdWxhdGlu
Zz8NCg0KQmVzdCBSZWdhcmRzLA0KSmFzb24gTGlhbw0KDQo=
--_000_B63C858E777679458338A30A991BB524015D1CBEG1W3780americas_
Content-Type: text/html; charset="gb2312"
Content-Transfer-Encoding: quoted-printable
<html
<head
<meta http-equiv=3D"Content-Type"
content=3D"text/html; charset=3Dgb2312"
<meta
name=3D"Generator" content=3D"Microsoft Word 15 (filtered medium)"
<style><!--
/* Font Definitions */
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:"HP Simplified";
panose-1:2 11 6 4 2 2 4 2 2 4;}
@font-face
{font-family:"YaHei Consolas Hybrid";
panose-1:2 11 5 9 2 2 4 2 2 4;}
@font-face
{font-family:"\@YaHei Consolas Hybrid";
panose-1:2 11 5 9 2 2 4 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
font-size:10.5pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal;
font-family:"HP Simplified","sans-serif";
color:windowtext;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"HP Simplified","sans-serif";
color:#7030A0;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" /
</xml><![endif]--><!--[if gte mso
9]><xml
<o:shapelayout
v:ext=3D"edit"
<o:idmap v:ext=3D"edit"
data=3D"1" /
</o:shapelayout></xml><![endif]--
</head
<body lang=3D"ZH-CN"
link=3D"#0563C1" vlink=3D"#954F72" style=3D"text-justi=
fy-trim:punctuation"
<div
class=3D"WordSection1"
<p
class=3D"MsoNormal"><span lang=3D"EN-US"
style=3D"font-family:"HP S=
implified","sans-serif";color:#7030A0">Hi
All,<o:p></o:p></s=
pan></p
<p
class=3D"MsoNormal"><span lang=3D"EN-US"
style=3D"font-family:"HP S=
implified","sans-serif";color:#7030A0"><o:p> </o:p></sp=
an></p
<p
class=3D"MsoNormal"><span lang=3D"EN-US"
style=3D"font-family:"HP S=
implified","sans-serif";color:#7030A0">Any feedback for
this=
topic?
<o:p></o:p></span></p
<p
class=3D"MsoNormal"><span lang=3D"EN-US"
style=3D"font-family:"HP S=
implified","sans-serif";color:#7030A0">Add Doron and
Martin =
in the mail list.<o:p></o:p></span></p
<p
class=3D"MsoNormal"><span lang=3D"EN-US"
style=3D"font-family:"HP S=
implified","sans-serif";color:#7030A0"><o:p> </o:p></sp=
an></p
<div
<p
class=3D"MsoNormal"><b><span lang=3D"EN-US"
style=3D"font-size:9.0pt;fon=
t-family:"HP
Simplified","sans-serif";color:black">Best=
Regards,<br
</span></b><span
lang=3D"EN-US" style=3D"font-size:9.0pt;font-family:"=
HP Simplified","sans-serif";color:#717172">Jason
Liao</span>=
<span lang=3D"EN-US"
style=3D"color:#7030A0"><o:p></o:p></span></p
</div
<p
class=3D"MsoNormal"><span lang=3D"EN-US"
style=3D"font-family:"HP S=
implified","sans-serif";color:#7030A0"><o:p> </o:p></sp=
an></p
<div
<div
style=3D"border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm =
0cm 0cm"
<p class=3D"MsoNormal"
align=3D"left" style=3D"text-align:left"><b><span la=
ng=3D"EN-US"
style=3D"font-size:11.0pt">From:</span></b><span
lang=3D"EN-US=
" style=3D"font-size:11.0pt"> vdsm-devel-bounces(a)lists.fedorahosted.org
[ma=
ilto:vdsm-devel-bounces@lists.fedorahosted.org]
<b>On Behalf Of </b>Liao, Chuan (Jason Liao, HPservers-Core-OE-PSC)<br
<b>Sent:</b> 2014</span><span
style=3D"font-size:11.0pt;font-family:SimSun"=
=C4=EA</span><span lang=3D"EN-US"
style=3D"font-size:11.0pt">3</span><span=
style=3D"font-size:11.0pt;font-family:SimSun">=D4=C2</span><span
lang=3D"E=
N-US" style=3D"font-size:11.0pt">11</span><span
style=3D"font-size:11.0pt;f=
ont-family:SimSun">=C8=D5</span><span lang=3D"EN-US"
style=3D"font-size:11.=
0pt"
14:02<br
<b>To:</b> vdsm-devel;
engine-devel(a)ovirt.org<br
<b>Cc:</b> Liang,
Shang-Chun (David Liang, HPservers-Core-OE-PSC); Vinod, C=
hegu; Gilad Chaplik<br
<b>Subject:</b> [vdsm]
Consider iowait add into usage CPU percentage<o:p></=
o:p></span></p
</div
</div
<p
class=3D"MsoNormal" align=3D"left"
style=3D"text-align:left"><span lang=
=3D"EN-US"><o:p> </o:p></span></p
<p class=3D"MsoNormal"><span
lang=3D"EN-US" style=3D"font-family:"HP S=
implified","sans-serif"">Hi
All,<o:p></o:p></span></p
<p
class=3D"MsoNormal"><span lang=3D"EN-US"
style=3D"font-family:"HP S=
implified","sans-serif""><o:p> </o:p></span></p
<p class=3D"MsoNormal"><span
lang=3D"EN-US" style=3D"font-family:"HP S=
implified","sans-serif"">On engine core, The usage CPU
perce=
ntage is calculated by %sys + %usr<o:p></o:p></span></p
<p class=3D"MsoNormal"><span
lang=3D"EN-US" style=3D"font-family:"HP S=
implified","sans-serif""><o:p> </o:p></span></p
<p class=3D"MsoNormal"><span
lang=3D"EN-US" style=3D"font-family:"HP S=
implified","sans-serif"">class VdsBrokerObjectsBuilder
<o:p></o:p></span></p
<p
class=3D"MsoNormal"><span lang=3D"EN-US"
style=3D"font-family:"HP S=
implified","sans-serif"">function
updateVDSStatisticsData<o:=
p></o:p></span></p
<p
class=3D"MsoNormal"
style=3D"margin-left:21.0pt;text-indent:21.0pt"><spa=
n lang=3D"EN-US" style=3D"font-family:"HP
Simplified","sans-=
serif"">vds.setCpuSys(AssignDoubleValue(xmlRpcStruct, VdsProperties.cp=
u_sys));<o:p></o:p></span></p
<p
class=3D"MsoNormal"><span lang=3D"EN-US"
style=3D"font-family:"HP S=
implified","sans-serif"">  =
; vds.setCpuUser(AssignDoubleValue(xmlRpcStruct, VdsProperties.cpu_us=
er));<o:p></o:p></span></p
<p
class=3D"MsoNormal"><span lang=3D"EN-US"
style=3D"font-family:"HP S=
implified","sans-serif"">  =
; if (vds.getCpuSys() !=3D null && vds.getCpuUser() !=3D null=
) {<o:p></o:p></span></p
<p
class=3D"MsoNormal"><span lang=3D"EN-US"
style=3D"font-family:"HP S=
implified","sans-serif"">  =
; vds.setUsageCpuPercent((int)
(vds.getCpuSys=
() + vds.getCpuUser()));<o:p></o:p></span></p
<p class=3D"MsoNormal"><span
lang=3D"EN-US" style=3D"font-family:"HP S=
implified","sans-serif"">  =
; }<o:p></o:p></span></p
<p
class=3D"MsoNormal"><span lang=3D"EN-US"
style=3D"font-family:"HP S=
implified","sans-serif""><o:p> </o:p></span></p
<p class=3D"MsoNormal"><span
lang=3D"EN-US" style=3D"font-family:"HP S=
implified","sans-serif"">On vdsm, The %sys, %usr and
%idle i=
s calculated like below workflow,<o:p></o:p></span></p
<p class=3D"MsoNormal"><span
lang=3D"EN-US" style=3D"font-family:"HP S=
implified","sans-serif""><o:p> </o:p></span></p
<p class=3D"MsoNormal"><span
lang=3D"EN-US" style=3D"font-family:"HP S=
implified","sans-serif"">class
API<o:p></o:p></span></p
<p
class=3D"MsoNormal"><span lang=3D"EN-US"
style=3D"font-family:"HP S=
implified","sans-serif"">function
getStats<o:p></o:p></span>=
</p
<p class=3D"MsoNormal"
style=3D"margin-left:21.0pt;text-indent:21.0pt"><spa=
n lang=3D"EN-US" style=3D"font-family:"HP
Simplified","sans-=
serif"">decStats =3D
self._cif._hostStats.get()<o:p></o:p></span></p
<p class=3D"MsoNormal"><span
lang=3D"EN-US" style=3D"font-family:"HP S=
implified","sans-serif"">class
clientIF<o:p></o:p></span></p=
<p class=3D"MsoNormal"><span
lang=3D"EN-US" style=3D"font-family:"HP S=
implified","sans-serif"">function
__init__<o:p></o:p></span>=
</p
<p class=3D"MsoNormal"><span
lang=3D"EN-US" style=3D"font-family:"HP S=
implified","sans-serif"">  =
;
s=
elf._hostStats =3D
sampling.HostStatsThread(log=3Dlog)<o:p></o:p></span></p=
<p class=3D"MsoNormal"><span
lang=3D"EN-US" style=3D"font-family:"HP S=
implified","sans-serif"">  =
; self._hostStats.start()<o:p></o:p></span></p
<p class=3D"MsoNormal"><span
lang=3D"EN-US" style=3D"font-family:"HP S=
implified","sans-serif"">class
HostStatsThread<o:p></o:p></s=
pan></p
<p
class=3D"MsoNormal"><span lang=3D"EN-US"
style=3D"font-family:"HP S=
implified","sans-serif"">function
get<o:p></o:p></span></p
<p
class=3D"MsoNormal"><span lang=3D"EN-US"
style=3D"font-family:"HP S=
implified","sans-serif"">  =
;
h=
s0, hs1 =3D self._samples[0],
self._samples[-1]<o:p></o:p></span></p
<p
class=3D"MsoNormal"><span lang=3D"EN-US"
style=3D"font-family:"HP S=
implified","sans-serif"">  =
;
=
=A1=AD<o:p></o:p></span></p
<p
class=3D"MsoNormal"><span lang=3D"EN-US"
style=3D"font-family:"HP S=
implified","sans-serif"">  =
;
j=
iffies =3D (hs1.totcpu.user - hs0.totcpu.user) % (2 **
32)<o:p></o:p></span=
></p
<p
class=3D"MsoNormal"><span lang=3D"EN-US"
style=3D"font-family:"HP S=
implified","sans-serif"">  =
; stats['cpuUser'] =3D jiffies / interval /
self._ncpus<o:p></o:p></s=
pan></p
<p
class=3D"MsoNormal"><span lang=3D"EN-US"
style=3D"font-family:"HP S=
implified","sans-serif"">  =
; jiffies =3D (hs1.totcpu.sys - hs0.totcpu.sys) % (2 ** 32)<o:p></o:p=
></span></p
<p
class=3D"MsoNormal"><span lang=3D"EN-US"
style=3D"font-family:"HP S=
implified","sans-serif"">  =
; stats['cpuSys'] =3D jiffies / interval /
self._ncpus<o:p></o:p></sp=
an></p
<p
class=3D"MsoNormal"><span lang=3D"EN-US"
style=3D"font-family:"HP S=
implified","sans-serif"">  =
; stats['cpuIdle'] =3D max(0.0, 100.0 - stats['cpuUser'] -
stats['cpu=
Sys'])<o:p></o:p></span></p
<p
class=3D"MsoNormal"><span lang=3D"EN-US"
style=3D"font-family:"HP S=
implified","sans-serif"">class
HostSample<o:p></o:p></span><=
/p
<p class=3D"MsoNormal"><span
lang=3D"EN-US" style=3D"font-family:"HP S=
implified","sans-serif"">function
__init__<o:p></o:p></span>=
</p
<p class=3D"MsoNormal"><span
lang=3D"EN-US" style=3D"font-family:"HP S=
implified","sans-serif"">  =
;
s=
elf.totcpu =3D TotalCpuSample()<o:p></o:p></span></p
<p class=3D"MsoNormal"><span
lang=3D"EN-US" style=3D"font-family:"HP S=
implified","sans-serif"">class
TotalCpuSample<o:p></o:p></sp=
an></p
<p
class=3D"MsoNormal"><span lang=3D"EN-US"
style=3D"font-family:"HP S=
implified","sans-serif"">function
__init__<o:p></o:p></span>=
</p
<p class=3D"MsoNormal"><span
lang=3D"EN-US" style=3D"font-family:"HP S=
implified","sans-serif"">  =
; self.user, userNice, self.sys, self.idle =3D
\<o:p></o:p></sp=
an></p
<p
class=3D"MsoNormal"><span lang=3D"EN-US"
style=3D"font-family:"HP S=
implified","sans-serif"">  =
; map(int,
file('/proc/stat').readline().spli=
t()[1:5])<o:p></o:p></span></p
<p
class=3D"MsoNormal"><span lang=3D"EN-US"
style=3D"font-family:"HP S=
implified","sans-serif"">  =
; self.user +=3D userNice<o:p></o:p></span></p
<p class=3D"MsoNormal"><span
lang=3D"EN-US" style=3D"font-family:"HP S=
implified","sans-serif""><o:p> </o:p></span></p
<p class=3D"MsoNormal"><span
lang=3D"EN-US" style=3D"font-family:"HP S=
implified","sans-serif"">Question1: Why
stats[=A1=AEcpuIdle=
=A1=AF] do not use the sampling data totcpu.idle for calculating?<o:p></o:p=
></span></p
<p
class=3D"MsoNormal"><span lang=3D"EN-US"
style=3D"font-family:"HP S=
implified","sans-serif""><o:p> </o:p></span></p
<p class=3D"MsoNormal"><span
lang=3D"EN-US" style=3D"font-family:"HP S=
implified","sans-serif"">Question2: There is another
data na=
med iowait in /proc/stat, do we need to consider add this into usage CPU pe=
rcentage for calculating?<o:p></o:p></span></p
<p class=3D"MsoNormal"><span
lang=3D"EN-US" style=3D"font-family:"HP S=
implified","sans-serif""><o:p> </o:p></span></p
<p class=3D"MsoNormal"><b><span
lang=3D"EN-US" style=3D"font-size:9.0pt;fon=
t-family:"HP
Simplified","sans-serif";color:black">Best=
Regards,<br
</span></b><span
lang=3D"EN-US" style=3D"font-size:9.0pt;font-family:"=
HP Simplified","sans-serif";color:#717172">Jason
Liao</span>=
<span lang=3D"EN-US"><o:p></o:p></span></p
<p class=3D"MsoNormal"><span
lang=3D"EN-US"><o:p> </o:p></span></p
</div
</body
</html
--_000_B63C858E777679458338A30A991BB524015D1CBEG1W3780americas_--