Skip to content

Commit

Permalink
Fixes to 0.6.0 with MkDocs 1.6.1 and mike 2.1.2 (#1672)
Browse files Browse the repository at this point in the history
Signed-off-by: Dave Kelsey <[email protected]>
Co-authored-by: Dave Kelsey <[email protected]>
  • Loading branch information
davidkel and Dave Kelsey authored Dec 10, 2024
1 parent 70b575d commit e168bfe
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
/docs
2 changes: 1 addition & 1 deletion 0.6.0/concepts/caliper-messengers/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion 0.6.0/concepts/logging-control/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion 0.6.0/concepts/rate-controllers/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
</span><span id=__span-11-7><a id=__codelineno-11-7 name=__codelineno-11-7 href=#__codelineno-11-7></a><span class=w> </span><span class=s2>&quot;defaultSleepTime&quot;</span>:<span class=w> </span><span class=m>50</span>
</span><span id=__span-11-8><a id=__codelineno-11-8 name=__codelineno-11-8 href=#__codelineno-11-8></a><span class=w> </span><span class=o>}</span>
</span><span id=__span-11-9><a id=__codelineno-11-9 name=__codelineno-11-9 href=#__codelineno-11-9></a><span class=o>}</span>
</span></code></pre></div> <p>The replay rate controller can be specified by setting the rate controller type to the <code>replay-rate</code> string. The available options (<code>opts</code> property) are the following:</p> <ul> <li><code>pathTemplate</code>: the template for the file path where the transaction timings will be replayed from. The path can be either an absolute path or relative to the root Caliper directory.</li> </ul> <p>The template can (<strong>and should</strong>) contain special “variables/placeholders” that can refer to special environment properties (see the remarks at the <a href=#record-rate>record rate controller</a>). The available placeholders are the following: - <code>&lt;C&gt;</code>: placeholder for the 1-based index of the current client that uses this rate controller. - <code>&lt;R&gt;</code>: placeholder for the 1-based index of the current round that uses this rate controller.</p> <ul> <li><code>inputFormat</code>: optional. Determines the format in which the transaction timings are stored (see the details at the <a href=#record-rate>record rate controller</a>). Defaults to <code>"TEXT"</code>. The currently supported formats are the following:<ul> <li><code>"TEXT"</code>: each recorded timing is encoded as text on separate lines.</li> <li><code>"BIN_BE"</code>: binary format with Big Endian encoding.</li> <li><code>"BIN_LE"</code>: binary format with Little Endian encoding.</li> </ul> </li> <li><code>logWarnings</code>: optional. Indicates whether to log that there are no more recordings to replay, so the <code>defaultSleepTime</code> is used between consecutive transactions. Defaults to <code>false</code>.</li> <li><code>defaultSleepTime</code>: optional. Determines the sleep time between transactions for the case when the benchmark execution is longer than the specified recording. Defaults to <code>20</code> ms.</li> </ul> <h3 id=about-the-recordings>About the recordings:<a class=headerlink href=#about-the-recordings title="Permanent link">&para;</a></h3> <p>Special care must be taken, when using duration-based benchmark execution, as it is possible to issue more transactions than specified in the recording. A safety measure for this case is the <code>defaultSleepTime</code> option. This should only occur in the last few moments of the execution, affecting only a few transactions, that can be discarded before performing additional performance analyses on the results.</p> <p>The recommended approach is to use transaction number-based round configurations, since the number of transactions to replay is known beforehand. Note, that the number of workers affects the actual number of transactions submitted by a worker.</p> <h2 id=adding-custom-controllers>Adding Custom Controllers<a class=headerlink href=#adding-custom-controllers title="Permanent link">&para;</a></h2> <p>It is possible to use rate controllers that are not built-in controllers of Caliper. When you specify the rate controller in the test configuration file (see the <a href=../../getting-started/architecture/ >architecture documentation</a>), you must set the <code>type</code> and <code>opts</code> attributes.</p> <p>You can set the <code>type</code> attribute so that it points to your custom JS file that satisfies the following criteria:</p> <ol> <li> <p>The file/module exports a <code>createRateController</code> function that takes the following parameters:</p> <ol> <li>An <code>TestMessage</code> parameter that is the <code>object</code> representation of the <code>opts</code> attribute set in the configuration file, and contains the custom settings of your rate controller.</li> <li>A <code>TransactionStatisticsCollector</code> object that gives the rate controller access to the current worker transaction statistics</li> <li>A <code>workerIndex</code> parameter of type number that is the 0-based index of the worker process using this rate controller. The function must return an object (i.e., your rate controller instance) that satisfies the next criteria.</li> </ol> </li> <li> <p>The object returned by <code>createRateController</code> must implement the <code>/packages/caliper-core/lib/rate-control/rateInterface.js</code> interface, i.e., must provide the following async functions:</p> </li> <li>applyRateControl , for performing the actual rate control by “blocking” the execution (in an async manner) for the desired time.</li> <li><code>end</code>, for disposing any acquired resources at the end of a round.</li> </ol> <p>The following example is a complete implementation of a rate control that doesn’t perform any control, thus allowing the submitting of transactions as fast as the program execution allows it (warning, this implementation run with many client processes could easily over-load a backend network, so use it with caution).</p> <div class="language-sh highlight"><pre><span></span><code><span id=__span-12-1><a id=__codelineno-12-1 name=__codelineno-12-1 href=#__codelineno-12-1></a>/*
</span></code></pre></div> <p>The replay rate controller can be specified by setting the rate controller type to the <code>replay-rate</code> string. The available options (<code>opts</code> property) are the following:</p> <ul> <li><code>pathTemplate</code>: the template for the file path where the transaction timings will be replayed from. The path can be either an absolute path or relative to the root Caliper directory.</li> </ul> <p>The template can (<strong>and should</strong>) contain special “variables/placeholders” that can refer to special environment properties (see the remarks at the <a href=#record-rate>record rate controller</a>). The available placeholders are the following: - <code>&lt;C&gt;</code>: placeholder for the 1-based index of the current client that uses this rate controller. - <code>&lt;R&gt;</code>: placeholder for the 1-based index of the current round that uses this rate controller.</p> <ul> <li><code>inputFormat</code>: optional. Determines the format in which the transaction timings are stored (see the details at the <a href=#record-rate>record rate controller</a>). Defaults to <code>"TEXT"</code>. The currently supported formats are the following:<ul> <li><code>"TEXT"</code>: each recorded timing is encoded as text on separate lines.</li> <li><code>"BIN_BE"</code>: binary format with Big Endian encoding.</li> <li><code>"BIN_LE"</code>: binary format with Little Endian encoding.</li> </ul> </li> <li><code>logWarnings</code>: optional. Indicates whether to log that there are no more recordings to replay, so the <code>defaultSleepTime</code> is used between consecutive transactions. Defaults to <code>false</code>.</li> <li><code>defaultSleepTime</code>: optional. Determines the sleep time between transactions for the case when the benchmark execution is longer than the specified recording. Defaults to <code>20</code> ms.</li> </ul> <h3 id=about-the-recordings>About the recordings:<a class=headerlink href=#about-the-recordings title="Permanent link">&para;</a></h3> <p>Special care must be taken, when using duration-based benchmark execution, as it is possible to issue more transactions than specified in the recording. A safety measure for this case is the <code>defaultSleepTime</code> option. This should only occur in the last few moments of the execution, affecting only a few transactions, that can be discarded before performing additional performance analyses on the results.</p> <p>The recommended approach is to use transaction number-based round configurations, since the number of transactions to replay is known beforehand. Note, that the number of workers affects the actual number of transactions submitted by a worker.</p> <h2 id=adding-custom-controllers>Adding Custom Controllers<a class=headerlink href=#adding-custom-controllers title="Permanent link">&para;</a></h2> <p>It is possible to use rate controllers that are not built-in controllers of Caliper. When you specify the rate controller in the test configuration file (see the <a href=../../getting-started/architecture/ >architecture documentation</a>), you must set the <code>type</code> and <code>opts</code> attributes.</p> <p>You can set the <code>type</code> attribute so that it points to your custom JS file that satisfies the following criteria:</p> <ol> <li> <p>The file/module exports a <code>createRateController</code> function that takes the following parameters:</p> <ol> <li>An <code>TestMessage</code> parameter that is the <code>object</code> representation of the <code>opts</code> attribute set in the configuration file, and contains the custom settings of your rate controller.</li> <li>A <code>TransactionStatisticsCollector</code> object that gives the rate controller access to the current worker transaction statistics</li> <li>A <code>workerIndex</code> parameter of type number that is the 0-based index of the worker process using this rate controller. The function must return an object (i.e., your rate controller instance) that satisfies the next criteria.</li> </ol> </li> <li> <p>The object returned by <code>createRateController</code> must implement the <code>/packages/caliper-core/lib/worker/rate-control/rateInterface.js</code> interface, i.e., must provide the following async functions:</p> </li> <li>applyRateControl , for performing the actual rate control by “blocking” the execution (in an async manner) for the desired time.</li> <li><code>end</code>, for disposing any acquired resources at the end of a round.</li> </ol> <p>The following example is a complete implementation of a rate control that doesn’t perform any control, thus allowing the submitting of transactions as fast as the program execution allows it (warning, this implementation run with many client processes could easily over-load a backend network, so use it with caution).</p> <div class="language-sh highlight"><pre><span></span><code><span id=__span-12-1><a id=__codelineno-12-1 name=__codelineno-12-1 href=#__codelineno-12-1></a>/*
</span><span id=__span-12-2><a id=__codelineno-12-2 name=__codelineno-12-2 href=#__codelineno-12-2></a>*<span class=w> </span>Licensed<span class=w> </span>under<span class=w> </span>the<span class=w> </span>Apache<span class=w> </span>License,<span class=w> </span>Version<span class=w> </span><span class=m>2</span>.0<span class=w> </span><span class=o>(</span>the<span class=w> </span><span class=s2>&quot;License&quot;</span><span class=o>)</span><span class=p>;</span>
</span><span id=__span-12-3><a id=__codelineno-12-3 name=__codelineno-12-3 href=#__codelineno-12-3></a>*<span class=w> </span>you<span class=w> </span>may<span class=w> </span>not<span class=w> </span>use<span class=w> </span>this<span class=w> </span>file<span class=w> </span>except<span class=w> </span><span class=k>in</span><span class=w> </span>compliance<span class=w> </span>with<span class=w> </span>the<span class=w> </span>License.
</span><span id=__span-12-4><a id=__codelineno-12-4 name=__codelineno-12-4 href=#__codelineno-12-4></a>*<span class=w> </span>You<span class=w> </span>may<span class=w> </span>obtain<span class=w> </span>a<span class=w> </span>copy<span class=w> </span>of<span class=w> </span>the<span class=w> </span>License<span class=w> </span>at
Expand Down
Loading

0 comments on commit e168bfe

Please sign in to comment.