[GSoC 2017] Instrumentation of Rust applications
"Saurav Sachidanand" <[email protected]> Fri, 3 Mar 2017 21:07:43 +0530
| Newsgroups | gmane.comp.sysutils.pcp |
|---|---|
| Message-ID | <[email protected]> |
--001a114a511aa998dc0549d553b0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello =E2=80=8B PCP developers=E2=80=8B , I'm =E2=80=8B Saurav Sachidanand, and I'm=E2=80=8B a CS sophomore studying in India =E2=80=8B. =E2=80=8BF=E2=80=8B or more than year =E2=80=8B I 've been programming in Rust =E2=80=8B =E2=80=8Band have published some personal projects in it ( =E2=80=8Bfew =E2=80=8B involving the Rust-C FFI) and =E2=80=8Bhave contributed a few patches to Servo (github.com/saurvs). =E2=80=8BThis year, =E2=80=8B I'm =E2=80=8Breally interested =E2=80=8B=E2=80=8B in =E2=80=8B the GSoC project for=E2=80=8B implementing a =E2=80=8Bnative =E2=80=8B Rust =E2=80=8Blibrary that enables =E2=80=8B=E2=80=8B instrumentation =E2=80=8B through PCP. =E2=80=8B =E2=80=8B I've =E2=80=8Bbegun exploring =E2=80=8Bthe =E2=80=8B PCP =E2=80=8B tools=E2=80=8B =E2=80=8Bon Fedora and have started reading up on the developer documentati= on. I've also =E2=80=8Bcloned the Speed =E2=80=8B repository and tried out the examples=E2=80=8B . =E2=80=8B After reading the project description and skimming through the Speed source code, I'm assuming the following are the deliverables involved with the project - native Rust library to write out metrics as memory mapped values - =E2=80=8Bnative Rust library, and command line utility, to dump metrics = from memory mapped values - a high-level Rust API to easily expose metrics from an application, following the pattern established in Speed (Client, Registry, Metric, Counter, Gauge etc.) =E2=80=8B- continuous integration through Travis CI, code coverage through = Codecov (coveralls doesn't support Rust)=E2=80=8B - documentation using rustdoc and host on Github Pages =E2=80=8B- as a separate library, Rust bindings to libpcp_trace=E2=80=8B - =E2=80=8B create Rust examples showing usage of the API, and also =E2=80=8B embedded this instrumentation capability to popular framework =E2=80=8Bs=E2=80=8B like hyper <https://github.com/hyperium/hyper> =E2=80=8B and iron=E2=80=8B <https://github.com/iron/iron> =E2=80=8B- as a stretch =E2=80=8Bgoal, implement a PCP agent in Rust to exp= ort metrics directly, similar to parfait-agent A major challenge in this project would be that in Rust there is no universally safe way to deal with memory mapped files, as there are very few, if any at all, compile-time guarantees the Rust compiler can make about reads and writes to an mmapped file. Hence, there's no support for it in the standard library. We'll have to write our own little module around libc::mmap to get only the functionality we need, or use a third party crate like memmap-rs <https://github.com/danburkert/memmap-rs> or rust-mmap <https://github.com/rbranson/rust-mmap>. Does this outline look good enough to begin writing a proposal?=E2=80=8B An= y feedback/comments on the above will be greatly appreciated. Thanks, Saurav --001a114a511aa998dc0549d553b0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:arial,he= lvetica,sans-serif"><div dir=3D"auto" style=3D"font-size:12.8px">Hello<div = class=3D"gmail_default" style=3D"display:inline">=E2=80=8B PCP developers= =E2=80=8B</div>,</div><div dir=3D"auto" style=3D"font-size:12.8px"><br></d= iv><div dir=3D"auto" style=3D"font-family:arial,sans-serif;font-size:12.8px= "><font face=3D"arial, helvetica, sans-serif">I'm</font><div class=3D"g= mail_default" style=3D"font-family:arial,helvetica,sans-serif;display:inlin= e">=E2=80=8B Saurav Sachidanand, and I'm=E2=80=8B</div><font face=3D"ar= ial, helvetica, sans-serif">=C2=A0a CS sophomore studying in India</font><d= iv class=3D"gmail_default" style=3D"font-family:arial,helvetica,sans-serif;= display:inline">=E2=80=8B.</div><font face=3D"arial, helvetica, sans-serif"= >=C2=A0</font><div class=3D"gmail_default" style=3D"font-family:arial,helve= tica,sans-serif;display:inline">=E2=80=8BF=E2=80=8B</div><font face=3D"aria= l, helvetica, sans-serif">or more than year</font><div class=3D"gmail_defau= lt" style=3D"font-family:arial,helvetica,sans-serif;display:inline">=E2=80= =8B I</div><span style=3D"font-family:arial,helvetica,sans-serif">'ve = been programming in Rust</span><div class=3D"gmail_default" style=3D"font-f= amily:arial,helvetica,sans-serif;display:inline">=E2=80=8B</div><span style= = =3D"font-family:arial,helvetica,sans-serif">=C2=A0<div class=3D"gmail_defa= ult" style=3D"display:inline">=E2=80=8Band have published</div>=C2=A0some p= ersonal projects in it (<div class=3D"gmail_default" style=3D"display:inlin= e">=E2=80=8Bfew =E2=80=8B</div>involving the Rust-C FFI) and=C2=A0<div clas= s=3D"gmail_default" style=3D"display:inline">=E2=80=8Bhave contributed a</d= iv>=C2=A0few patches to Servo (</span><a href=3D"http://github.com/saurvs" = style=3D"color:rgb(66,133,244);font-family:arial,helvetica,sans-serif;text-= decoration:none" target=3D"_blank">github.com/saurvs</a><span style=3D"font= -family:arial,helvetica,sans-serif">).=C2=A0<div class=3D"gmail_default" st= yle=3D"display:inline">=E2=80=8BThis year, =E2=80=8B</div>I'm=C2=A0</sp= an><div class=3D"gmail_default" style=3D"font-family:arial,helvetica,sans-s= erif;display:inline">=E2=80=8Breally</div><span style=3D"font-family:arial,= helvetica,sans-serif">=C2=A0interested</span><div class=3D"gmail_default" s= tyle=3D"font-family:arial,helvetica,sans-serif;display:inline">=E2=80=8B=E2= = =80=8B</div><span style=3D"font-family:arial,helvetica,sans-serif">=C2=A0i= n</span><div class=3D"gmail_default" style=3D"font-family:arial,helvetica,s= ans-serif;display:inline">=E2=80=8B the GSoC project for=E2=80=8B</div><spa= n style=3D"font-family:arial,helvetica,sans-serif">=C2=A0implementing a=C2= =A0</span><div class=3D"gmail_default" style=3D"font-family:arial,helvetic= a,sans-serif;display:inline">=E2=80=8Bnative =E2=80=8B</div><span style=3D"= font-family:arial,helvetica,sans-serif">Rust=C2=A0</span><div class=3D"gmai= l_default" style=3D"font-family:arial,helvetica,sans-serif;display:inline">= = =E2=80=8Blibrary</div><font face=3D"arial, helvetica, sans-serif">=C2=A0th= at enables=C2=A0</font><div class=3D"gmail_default" style=3D"font-family:ar= ial,helvetica,sans-serif;display:inline">=E2=80=8B=E2=80=8B</div><font face= = =3D"arial, helvetica, sans-serif">instrumentation</font><div class=3D"gmai= l_default" style=3D"display:inline"><font face=3D"arial, helvetica, sans-se= rif">=E2=80=8B</font></div><font face=3D"arial, helvetica, sans-serif">=C2= =A0through PCP.<div class=3D"gmail_default" style=3D"display:inline">=E2= =80=8B =E2=80=8B</div></font><span style=3D"font-family:arial,helvetica,sa= ns-serif">I've=C2=A0</span><div class=3D"gmail_default" style=3D"font-f= amily:arial,helvetica,sans-serif;display:inline">=E2=80=8Bbegun exploring</= div><span style=3D"font-family:arial,helvetica,sans-serif">=C2=A0</span><di= v class=3D"gmail_default" style=3D"font-family:arial,helvetica,sans-serif;d= isplay:inline">=E2=80=8Bthe =E2=80=8B</div><span style=3D"font-family:arial= ,helvetica,sans-serif">PCP</span><div class=3D"gmail_default" style=3D"font= -family:arial,helvetica,sans-serif;display:inline">=E2=80=8B tools=E2=80=8B= </div><span style=3D"font-family:arial,helvetica,sans-serif">=C2=A0</span><= div class=3D"gmail_default" style=3D"font-family:arial,helvetica,sans-serif= ;display:inline">=E2=80=8Bon Fedora and have started reading up on the deve= loper documentation. I've also</div><span style=3D"font-family:arial,he= lvetica,sans-serif">=C2=A0</span><div class=3D"gmail_default" style=3D"font= -family:arial,helvetica,sans-serif;display:inline">=E2=80=8Bcloned the</div= ><span style=3D"font-family:arial,helvetica,sans-serif">=C2=A0Speed</span><= div class=3D"gmail_default" style=3D"font-family:arial,helvetica,sans-serif= ;display:inline">=E2=80=8B repository and tried out the examples=E2=80=8B</= div><span style=3D"font-family:arial,helvetica,sans-serif">.</span><div cla= ss=3D"gmail_default" style=3D"font-family:arial,helvetica,sans-serif;displa= y:inline">=E2=80=8B</div></div><div dir=3D"auto" style=3D"font-size:12.8px"= ><div class=3D"gmail_default" style=3D"display:inline"><br></div></div><div= dir=3D"auto" style=3D"font-size:12.8px"><div class=3D"gmail_default" style= = =3D"display:inline">After reading the project description and skimming thr= ough the Speed source code, I'm assuming the following are the delivera= bles involved with the project</div></div><div dir=3D"auto" style=3D"font-s= ize:12.8px"><div class=3D"gmail_default">- native Rust library to write out= metrics as memory mapped values</div><div class=3D"gmail_default">- =C2=A0= = =E2=80=8Bnative Rust library, and command line utility, to dump metrics fr= om memory mapped values</div><div class=3D"gmail_default">- a high-level Ru= st API to easily expose metrics from an application, following the pattern = established in Speed (Client, Registry, Metric, Counter, Gauge etc.)</div><= div class=3D"gmail_default">=E2=80=8B- continuous integration through Travi= s CI, code coverage through Codecov (coveralls doesn't support Rust)=E2= = =80=8B</div><div class=3D"gmail_default">- documentation using rustdoc and= host on Github Pages</div><div class=3D"gmail_default">=E2=80=8B- as a sep= arate library, Rust bindings to libpcp_trace=E2=80=8B</div><div class=3D"gm= ail_default"><div style=3D"font-size:12.8px">-<div class=3D"gmail_default" = style=3D"display:inline">=E2=80=8B create Rust examples showing usage of th= e API, and also =E2=80=8B</div>embedded this instrumentation capability to = popular framework<div class=3D"gmail_default" style=3D"display:inline">=E2= =80=8Bs=E2=80=8B</div>=C2=A0like<a href=3D"https://github.com/hyperium/hyp= er" target=3D"_blank">=C2=A0hyper</a><div class=3D"gmail_default" style=3D"= display:inline">=E2=80=8B and=C2=A0<a href=3D"https://github.com/iron/iron"= target=3D"_blank">iron=E2=80=8B</a></div></div><div style=3D"font-size:12.= 8px"><div class=3D"gmail_default">=E2=80=8B- as a stretch =E2=80=8Bgoal, im= plement a PCP agent in Rust to export metrics directly, similar to parfait-= agent</div></div></div><div class=3D"gmail_default"><br></div><div class=3D= "gmail_default">A major challenge in this project would be that in Rust the= re is no universally safe way to deal with memory mapped files, as there ar= e very few, if any at all, compile-time guarantees the Rust compiler can ma= ke about reads and writes to an mmapped file. Hence, there's no support= for it in the standard library. We'll have to write our own little mod= ule around libc::mmap to get only the functionality we need, or use a third= party crate like=C2=A0<a href=3D"https://github.com/danburkert/memmap-rs" = target=3D"_blank">memmap-rs</a>=C2=A0or=C2=A0<a href=3D"https://github.com/= rbranson/rust-mmap" target=3D"_blank">rust-mmap</a>.</div><div class=3D"gma= il_default"><br></div></div><div dir=3D"auto" style=3D"font-size:12.8px"><d= iv class=3D"gmail_default" style=3D"display:inline"><span style=3D"font-siz= e:12.8px">Does this outline look good enough to begin writing a proposal?= =E2=80=8B</span>=C2=A0Any feedback/comments on the above will be greatly a= ppreciated.</div></div><div dir=3D"auto" style=3D"font-size:12.8px"><br></d= iv><div dir=3D"auto" style=3D"font-size:12.8px">Thanks,</div><div dir=3D"au= to" style=3D"font-size:12.8px">Saurav</div></div></div> <div width=3D"1" style=3D"color:white;clear:both">_._,_._,_</div> <hr> Groups.io Links:<p> You receive all messages sent to this group. <p> <a target=3D"_blank" href=3D"https://groups.io/g/pcp/message/15306">View/R= eply Online (#15306)</a> | <a target=3D"_blank" href=3D"mailto:[email protected]?subject=3DRe:%20%5Bpcp= %5D%20%5BGSoC%202017%5D%20Instrumentation%20of%20Rust%20applications">Reply= To Group</a> | <a target=3D"_blank" href=3D"mailto:[email protected]?subj= ect=3DRe:%20%5Bpcp%5D%20%5BGSoC%202017%5D%20Instrumentation%20of%20Rust%20a= pplications">Reply To Sender</a> | <a target=3D"_blank" href=3D"https://groups.io/mt/4461364?uid=3D174580">= Mute This Topic</a> =20 | <a href=3D"https://groups.io/g/pcp/post">New Topic</a><br> <p>pcp mailing list<br />[email protected]<br /><a href=3D"https://groups.io/g= /pcp/messages" target=3D"_blank">https://groups.io/g/pcp/messages</a></p> <a href=3D"https://groups.io/g/pcp/editsub?uid=3D174580">Change Your Subsc= ription</a><br> <a href=3D"https://groups.io/g/pcp">Group Home</a><br> <a href=3D"mailto:[email protected]">Contact Group Owner</a><br> <a href=3D"https://groups.io/static/tos">Terms Of Service</a><br> <a href=3D"https://groups.io/g/pcp/leave/354243/563757577/xyzzy">Unsubscri= be From This Group</a><br> <div width=3D"1" style=3D"color:white;clear:both">_._,_._,_</div> --001a114a511aa998dc0549d553b0--