Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  chap2.html   Sprache: HTML

 
 products/sources/formale Sprachen/GAP/pkg/profiling/doc/chap2.html


<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>GAP (profiling) - Chapter 2: Functionality provided by the profiling package</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="generator" content="GAPDoc2HTML" />
<link rel="stylesheet" type="text/css" href="manual.css" />
<script src="manual.js" type="text/javascript"></script>
<script type="text/javascript">overwriteStyle();</script>
</head>
<body class="chap2"  onload="jscontent()">


<div class="chlinktop"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a>  <a href="chap1.html">1</a>  <a href="chap2.html">2</a>  <a href="chapInd.html">Ind</a>  </div>

<div class="chlinkprevnexttop"> <a href="chap0.html">[Top of Book]</a>   <a href="chap0.html#contents">[Contents]</a>    <a href="chap1.html">[Previous Chapter]</a>    <a href="chapInd.html">[Next Chapter]</a>   </div>

<p id="mathjaxlink" class="pcenter"><a href="chap2_mj.html">[MathJax on]</a></p>
<p><a id="X7DAD51718553414E" name="X7DAD51718553414E"></a></p>
<div class="ChapSects"><a href="chap2.html#X7DAD51718553414E">2 <span class="Heading">Functionality provided by the <strong class="pkg">profiling</strong> package</span></a>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap2.html#X824EFBE480A1360F">2.1 <span class="Heading">Reading line-by-line profiles</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap2.html#X82664B2C80EBA9A4">2.1-1 ReadLineByLineProfile</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap2.html#X7D11F90387AEF584">2.1-2 MergeLineByLineProfiles</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap2.html#X8412FE417B2C715D">2.2 <span class="Heading">Generating flame graphs</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap2.html#X858B23AD78A2A73A">2.2-1 OutputFlameGraph</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap2.html#X7C6110C180DE1785">2.2-2 OutputFlameGraphInput</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap2.html#X83A7B4B07A62FB8F">2.3 <span class="Heading">Generating coverage reports</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap2.html#X87AFADF581A7C1FD">2.3-1 OutputAnnotatedCodeCoverageFiles</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap2.html#X8436F6FE84513AC9">2.3-2 OutputJsonCoverage</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap2.html#X815BCEEA86E01699">2.3-3 OutputLcovCoverage</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap2.html#X86CA50397AB60E33">2.3-4 OutputCoverallsJsonCoverage</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap2.html#X7C5563A37D566DA5">2.4 <span class="Heading">Miscellaneous</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap2.html#X849267DE7D84CBBE">2.4-1 LineByLineProfileFunction</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap2.html#X7B979D50793E455A">2.4-2 ProfileFile</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap2.html#X80F26AB17D5D8752">2.4-3 ProfilePackage</a></span>
</div></div>
</div>

<h3>2 <span class="Heading">Functionality provided by the <strong class="pkg">profiling</strong> package</span></h3>

<p><a id="X824EFBE480A1360F" name="X824EFBE480A1360F"></a></p>

<h4>2.1 <span class="Heading">Reading line-by-line profiles</span></h4>

<p><a id="X82664B2C80EBA9A4" name="X82664B2C80EBA9A4"></a></p>

<h5>2.1-1 ReadLineByLineProfile</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ ReadLineByLineProfile</code>( <var class="Arg">filename</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Read <var class="Arg">filename</var>, a line-by-line profile which was previously generated by <strong class="pkg">GAP</strong>, using the <code class="func">ProfileLineByLine</code> (<a href="../../../doc/ref/chap7_mj.html#X86557887796F66FA"><span class="RefLink">Reference: ProfileLineByLine</span></a>) or <code class="func">CoverageLineByLine</code> (<a href="../../../doc/ref/chap7_mj.html#X87CC48807DB4C008"><span class="RefLink">Reference: CoverageLineByLine</span></a>) functions from core <strong class="pkg">GAP</strong>. A parsed profile can be transformed into a human-readable form using either <code class="func">OutputAnnotatedCodeCoverageFiles</code> (<a href="chap2.html#X87AFADF581A7C1FD"><span class="RefLink">2.3-1</span></a>) or <code class="func">OutputFlameGraph</code> (<a href="chap2.html#X858B23AD78A2A73A"><span class="RefLink">2.2-1</span></a>)</p>

<p><a id="X7D11F90387AEF584" name="X7D11F90387AEF584"></a></p>

<h5>2.1-2 MergeLineByLineProfiles</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ MergeLineByLineProfiles</code>( <var class="Arg">filenames</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Read <var class="Arg">filenames</var>, a list of line-by-line profiles which were previously generated by <strong class="pkg">GAP</strong>, using the <code class="func">ProfileLineByLine</code> (<a href="../../../doc/ref/chap7_mj.html#X86557887796F66FA"><span class="RefLink">Reference: ProfileLineByLine</span></a>) or <code class="func">CoverageLineByLine</code> (<a href="../../../doc/ref/chap7_mj.html#X87CC48807DB4C008"><span class="RefLink">Reference: CoverageLineByLine</span></a>) functions from core <strong class="pkg">GAP</strong>. The elements of <var class="Arg">filenames</var> can be either filenames, or files previously parsed by <code class="func">ReadLineByLineProfile</code> (<a href="chap2.html#X82664B2C80EBA9A4"><span class="RefLink">2.1-1</span></a>).</p>

<p><a id="X8412FE417B2C715D" name="X8412FE417B2C715D"></a></p>

<h4>2.2 <span class="Heading">Generating flame graphs</span></h4>

<p>A 'flame graph' is a method of visualising where time is spent by a program.</p>

<p><a id="X858B23AD78A2A73A" name="X858B23AD78A2A73A"></a></p>

<h5>2.2-1 OutputFlameGraph</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ OutputFlameGraph</code>( <var class="Arg">profile</var>[, <var class="Arg">filename</var>][, <var class="Arg">options</var>] )</td><td class="tdright">( function )</td></tr></table></div>
<p>Generate an 'svg' file which represents a 'flame graph', a method of visualising where time is spent by a program.</p>

<p><var class="Arg">profile</var> should be either a profile previously read by <code class="func">ReadLineByLineProfile</code> (<a href="chap2.html#X82664B2C80EBA9A4"><span class="RefLink">2.1-1</span></a>), or a string giving the filename of a profile.</p>

<p>The flame graph will be written to <var class="Arg">filename</var> (or returned as a string if <var class="Arg">filename</var> is not present).</p>

<p>The final (optional) argument is a record of options. Currently, the allowed options are 'squash' (which is a boolean). If 'squash' is true then recursive functions calls will be squashed, so the graph will not show recursive functions calling themselves. The other allowed option is 'type', which can be "default" (a standard flamegraph) or "reverse" (reverse the graph, showing the leaf functions first)</p>

<p><a id="X7C6110C180DE1785" name="X7C6110C180DE1785"></a></p>

<h5>2.2-2 OutputFlameGraphInput</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ OutputFlameGraphInput</code>( <var class="Arg">profile</var>[, <var class="Arg">filename</var>] )</td><td class="tdright">( function )</td></tr></table></div>
<p>Generate the input required to draw a 'flame graph', a method of visualising where time is spent by a program. One program for drawing flame graphs using this output can be found at <span class="URL"><a href="https://github.com/brendangregg/FlameGraph">https://github.com/brendangregg/FlameGraph</a></span>.</p>

<p><var class="Arg">profile</var> should be either a profile previously read by <code class="func">ReadLineByLineProfile</code> (<a href="chap2.html#X82664B2C80EBA9A4"><span class="RefLink">2.1-1</span></a>), or a string giving the filename of a profile.</p>

<p>The flame graph input will be written to <var class="Arg">filename</var> (or returned as a string if <var class="Arg">filename</var> is not present).</p>

<p><a id="X83A7B4B07A62FB8F" name="X83A7B4B07A62FB8F"></a></p>

<h4>2.3 <span class="Heading">Generating coverage reports</span></h4>

<p><a id="X87AFADF581A7C1FD" name="X87AFADF581A7C1FD"></a></p>

<h5>2.3-1 OutputAnnotatedCodeCoverageFiles</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ OutputAnnotatedCodeCoverageFiles</code>( <var class="Arg">coverage</var>[, <var class="Arg">indir</var>], <var class="Arg">outdir</var>[, <var class="Arg">options</var>] )</td><td class="tdright">( function )</td></tr></table></div>
<p>Takes a previously generated profile and outputs HTML which shows the lines of code that were executed, and (if this was originally recorded) how long was spent executing these lines of code.</p>

<p><var class="Arg">coverage</var> should be either a profile previously read by <code class="func">ReadLineByLineProfile</code> (<a href="chap2.html#X82664B2C80EBA9A4"><span class="RefLink">2.1-1</span></a>), or a string giving the filename of a profile which will first be read with <code class="file">ReadLineByLineProfile</code>.</p>

<p>Files will be written to the directory <var class="Arg">outdir</var>.</p>

<p>The optional second argument gives a filter, only information about filenames starting with <var class="Arg">indir</var> will be outputted.</p>

<p>The final optional argument is a record of configuration options. The only currently allowed option is 'title', which will set the title of created pages.</p>

<p><a id="X8436F6FE84513AC9" name="X8436F6FE84513AC9"></a></p>

<h5>2.3-2 OutputJsonCoverage</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ OutputJsonCoverage</code>( <var class="Arg">coverage</var>, <var class="Arg">outfile</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Takes a previously generated profile and outputs a json coverage file which is amongst other things accepted by <span class="URL"><a href="codecov.io">codecov.io</a></span>.</p>

<p><var class="Arg">coverage</var> should be either a profile previously read by <code class="func">ReadLineByLineProfile</code> (<a href="chap2.html#X82664B2C80EBA9A4"><span class="RefLink">2.1-1</span></a>), or a string giving the filename of a profile which will first be read with <code class="file">ReadLineByLineProfile</code>.</p>

<p>The output will be written to the file with name <var class="Arg">outfile</var> (a string).</p>

<p><a id="X815BCEEA86E01699" name="X815BCEEA86E01699"></a></p>

<h5>2.3-3 OutputLcovCoverage</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ OutputLcovCoverage</code>( <var class="Arg">coverage</var>, <var class="Arg">outfile</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Takes a previously generated profile and outputs an lcov coverage file.</p>

<p><var class="Arg">coverage</var> should be either a profile previously read by <code class="func">ReadLineByLineProfile</code> (<a href="chap2.html#X82664B2C80EBA9A4"><span class="RefLink">2.1-1</span></a>), or the filename of a profile which will first be read with <code class="file">ReadLineByLineProfile</code>.</p>

<p>The output will be written to the file with name <var class="Arg">outfile</var> (a string).</p>

<p><a id="X86CA50397AB60E33" name="X86CA50397AB60E33"></a></p>

<h5>2.3-4 OutputCoverallsJsonCoverage</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ OutputCoverallsJsonCoverage</code>( <var class="Arg">coverage</var>, <var class="Arg">outfile</var>, <var class="Arg">pathtoremove</var>[, <var class="Arg">opt</var>] )</td><td class="tdright">( function )</td></tr></table></div>
<p>Takes a previously generated profile and outputs a json coverage file which is accepted by <span class="URL"><a href="coveralls.io">coveralls.io</a></span>.</p>

<p><var class="Arg">coverage</var> should be either a profile previously read by <code class="func">ReadLineByLineProfile</code> (<a href="chap2.html#X82664B2C80EBA9A4"><span class="RefLink">2.1-1</span></a>), or a string giving the filename of a profile which will first be read with <code class="file">ReadLineByLineProfile</code>. <var class="Arg">pathtoremove</var> is the path to the tested repository; this path prefix will be removed from all filenames in <var class="Arg">coverage</var>. Finally, <var class="Arg">opt</var> is a record. Its key/value pairs are directly inserted into the produced JSON, in the form of a JSON dictionary. This can be used to set the <code class="code">service_name</code>, <code class="code">service_job_id</code>, and more. If this record is not given, we try to guess the correct values based on the environment (currently only supported for Travis and AppVeyor).</p>

<p>The output will be written to the file with name <var class="Arg">outfile</var> (a string).</p>

<p><a id="X7C5563A37D566DA5" name="X7C5563A37D566DA5"></a></p>

<h4>2.4 <span class="Heading">Miscellaneous</span></h4>

<p><a id="X849267DE7D84CBBE" name="X849267DE7D84CBBE"></a></p>

<h5>2.4-1 LineByLineProfileFunction</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ LineByLineProfileFunction</code>( <var class="Arg">function</var>, <var class="Arg">arguments</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Calls <var class="Arg">function</var> with the list of arguments <var class="Arg">arguments</var>, and opens a time profile of the resulting call in the default web browser.</p>

<p><a id="X7B979D50793E455A" name="X7B979D50793E455A"></a></p>

<h5>2.4-2 ProfileFile</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ ProfileFile</code>( <var class="Arg">file</var>[, <var class="Arg">opts</var>] )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: a string</p>

<p>Tests the file with name <var class="Arg">file</var> in another <strong class="pkg">GAP</strong> session, and produces a code coverage report of lines that were executed in the process. If <var class="Arg">file</var> ends with <code class="code">.tst</code> it will be called with <code class="code">Test</code>; otherwise, it will be run directly.</p>

<p>The optional argument <var class="Arg">opts</var> should be a record, and may contain any of the following components:</p>


<ul>
<li><p><code class="code">outdir</code>: a string denoting the directory into which the HTML files of the report will be placed (a temporary directory by default);</p>

</li>
<li><p><code class="code">indir</code>: a string such that only file paths beginning with <code class="code">indir</code> will be profiled (default <code class="code">""</code>);</p>

</li>
<li><p><code class="code">showOutput</code>: a boolean denoting whether to print test output to the screen (default <code class="keyw">true</code>);</p>

</li>
<li><p><code class="code">open</code>: a boolean denoting whether to open the report in a web browser on completion (default <code class="keyw">false</code>).</p>

</li>
</ul>
<p>This function returns the location of an HTML file containing the report.</p>

<p><a id="X80F26AB17D5D8752" name="X80F26AB17D5D8752"></a></p>

<h5>2.4-3 ProfilePackage</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ ProfilePackage</code>( <var class="Arg">pkg_name</var>[, <var class="Arg">opts</var>] )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: a string</p>

<p>If <var class="Arg">pkg_name</var> is the name of an installed package, then this function runs that package's test suite and produces a report on the code coverage of files inside the package. The string returned denotes the location of an HTML file containing the report. The optional argument opts behaves the same as in ProfileFile (2.4-2).




<div class="chlinkprevnextbot"> <a href="chap0.html">[Top of Book]</a>   <a href="chap0.html#contents">[Contents]</a>    <a href="chap1.html">[Previous Chapter]</a>    <a href="chapInd.html">[Next Chapter]</a>   </div>


<div class="chlinkbot"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a>  <a href="chap1.html">1</a>  <a href="chap2.html">2</a>  <a href="chapInd.html">Ind</a>  </div>

<hr />
<p class="foot">generated by <a href="https://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc">GAPDoc2HTML</a></p>
</body>
</html>

100%


¤ Dauer der Verarbeitung: 0.22 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung ist noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge