mirror of
https://github.com/rtbrick/bngblaster.git
synced 2024-05-06 15:54:57 +00:00
480 lines
28 KiB
HTML
480 lines
28 KiB
HTML
<!DOCTYPE html>
|
||
<html class="writer-html5" lang="en" data-content_root="./">
|
||
<head>
|
||
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
|
||
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||
<title>Controller — BNG Blaster 0.8 documentation</title>
|
||
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=80d5e7a1" />
|
||
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=19f00094" />
|
||
<link rel="stylesheet" type="text/css" href="_static/tabs.css?v=a5c4661c" />
|
||
<link rel="stylesheet" type="text/css" href="_static/custom.css?v=411f5019" />
|
||
|
||
|
||
<!--[if lt IE 9]>
|
||
<script src="_static/js/html5shiv.min.js"></script>
|
||
<![endif]-->
|
||
|
||
<script src="_static/jquery.js?v=5d32c60e"></script>
|
||
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
|
||
<script src="_static/documentation_options.js?v=a0e24af7"></script>
|
||
<script src="_static/doctools.js?v=888ff710"></script>
|
||
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
|
||
<script src="_static/js/theme.js"></script>
|
||
<link rel="index" title="Index" href="genindex.html" />
|
||
<link rel="search" title="Search" href="search.html" />
|
||
<link rel="next" title="Performance Guide" href="performance.html" />
|
||
<link rel="prev" title="API/CLI" href="api/index.html" />
|
||
</head>
|
||
|
||
<body class="wy-body-for-nav">
|
||
<div class="wy-grid-for-nav">
|
||
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
||
<div class="wy-side-scroll">
|
||
<div class="wy-side-nav-search" >
|
||
|
||
|
||
|
||
<a href="index.html" class="icon icon-home">
|
||
BNG Blaster
|
||
<img src="_static/rtbrick_logo.png" class="logo" alt="Logo"/>
|
||
</a>
|
||
<div role="search">
|
||
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
|
||
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
|
||
<input type="hidden" name="check_keywords" value="yes" />
|
||
<input type="hidden" name="area" value="default" />
|
||
</form>
|
||
</div>
|
||
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
|
||
<ul class="current">
|
||
<li class="toctree-l1"><a class="reference internal" href="install.html">Installation</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="quickstart.html">Quickstart Guide</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="interfaces.html">Interfaces</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="access/index.html">Access Protocols</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="routing/index.html">Routing Protocols</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="streams.html">Traffic Streams</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="http.html">HTTP Emulation</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="nat.html">NAT / CGNAT</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="reports.html">Reports</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="configuration/index.html">Configuration</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="api/index.html">API/CLI</a></li>
|
||
<li class="toctree-l1 current"><a class="current reference internal" href="#">Controller</a><ul>
|
||
<li class="toctree-l2"><a class="reference internal" href="#installation">Installation</a></li>
|
||
<li class="toctree-l2"><a class="reference internal" href="#api">API</a><ul>
|
||
<li class="toctree-l3"><a class="reference internal" href="#create-test-instance">Create Test Instance</a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#start-test">Start Test</a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#status">Status</a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#command">Command</a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#stop-test">Stop Test</a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#delete-test-instance">Delete Test Instance</a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#reports">Reports</a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#logs">Logs</a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#pcap">PCAP</a></li>
|
||
<li class="toctree-l3"><a class="reference internal" href="#metrics">Metrics</a></li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li class="toctree-l1"><a class="reference internal" href="performance.html">Performance Guide</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="troubleshooting.html">Troubleshooting</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="faq.html">Frequently Asked Questions</a></li>
|
||
</ul>
|
||
|
||
</div>
|
||
</div>
|
||
</nav>
|
||
|
||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
|
||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
||
<a href="index.html">BNG Blaster</a>
|
||
</nav>
|
||
|
||
<div class="wy-nav-content">
|
||
<div class="rst-content">
|
||
<div role="navigation" aria-label="Page navigation">
|
||
<ul class="wy-breadcrumbs">
|
||
<li><a href="index.html" class="icon icon-home" aria-label="Home"></a></li>
|
||
<li class="breadcrumb-item active">Controller</li>
|
||
<li class="wy-breadcrumbs-aside">
|
||
<a href="_sources/controller.rst.txt" rel="nofollow"> View page source</a>
|
||
</li>
|
||
</ul>
|
||
<hr/>
|
||
</div>
|
||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
||
<div itemprop="articleBody">
|
||
|
||
<section id="controller">
|
||
<span id="id1"></span><h1>Controller<a class="headerlink" href="#controller" title="Link to this heading"></a></h1>
|
||
<p>The BNG Blaster controller offers a convenient REST API that allows users to start and stop
|
||
multiple test instances with ease. The REST API serves as an interface to the BNG Blaster’s
|
||
underlying functionality, providing a simplified way to interact with the controller and
|
||
manage test instances.</p>
|
||
<p>By exposing the BNG Blaster <a class="reference internal" href="api/index.html#api"><span class="std std-ref">JSON RPC API</span></a> as a REST API, the controller enables
|
||
users to perform various operations programmatically. This includes initiating test instances,
|
||
configuring test parameters, monitoring test progress, and terminating test executions.
|
||
The REST API provides a standardized and intuitive way to control the BNG Blaster, making it
|
||
accessible to automation scripts, external applications, or custom integrations.</p>
|
||
<p>Furthermore, the BNG Blaster controller’s REST API also offers endpoints to download logs and reports.
|
||
These endpoints enable users to retrieve detailed information about the test execution, such as
|
||
test results, performance metrics, and any encountered errors or issues. By accessing logs and reports
|
||
through the REST API, users can analyze the outcomes of their tests, troubleshoot problems, and generate
|
||
comprehensive documentation for further analysis or reporting purposes.</p>
|
||
<p>The REST API provided by the BNG Blaster controller simplifies the management of test instances and
|
||
enhances the overall usability and integration capabilities of the BNG Blaster. Whether it’s starting
|
||
and stopping tests, retrieving logs and reports, or integrating with other systems, the REST API streamlines
|
||
the testing process and facilitates seamless interaction with the BNG Blaster’s functionalities.</p>
|
||
<p><a class="reference external" href="https://github.com/rtbrick/bngblaster-controller">https://github.com/rtbrick/bngblaster-controller</a></p>
|
||
<img alt="BNG Blaster Controller" src="_images/controller.png" />
|
||
<section id="installation">
|
||
<h2>Installation<a class="headerlink" href="#installation" title="Link to this heading"></a></h2>
|
||
<p>The BNG Blaster controller should run on any modern Linux distribution
|
||
but is primarily tested on Ubuntu 18.04 LTS, Ubuntu 20.04 LTS and
|
||
Ubuntu 22.04 LTS (recommended).</p>
|
||
<p>Download and install Debian package: <a class="reference external" href="https://github.com/rtbrick/bngblaster-controller/releases">https://github.com/rtbrick/bngblaster-controller/releases</a></p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ wget https://github.com/rtbrick/bngblaster-controller/releases/download/<version>/bngblaster-controller_<version>_amd64.deb
|
||
$ sudo dpkg -i bngblaster-controller_<version>_amd64.deb
|
||
</pre></div>
|
||
</div>
|
||
<p>The corresponding service will be started automatically.</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ systemctl status rtbrick-bngblasterctrl.service
|
||
● rtbrick-bngblasterctrl.service - RtBrick BNG Blaster Controller
|
||
Loaded: loaded (/lib/systemd/system/rtbrick-bngblasterctrl.service; enabled; vendor preset: enabled)
|
||
Active: active (running) since Fri 2022-07-01 11:14:01 UTC; 7min ago
|
||
Main PID: 682535 (bngblasterctrl)
|
||
Tasks: 8 (limit: 309235)
|
||
Memory: 2.6M
|
||
CGroup: /system.slice/rtbrick-bngblasterctrl.service
|
||
└─682535 /usr/local/bin/bngblasterctrl
|
||
</pre></div>
|
||
</div>
|
||
<p>The BNG Blaster controller listens on port <cite>8001</cite> per default,
|
||
which can be changed using the argument <cite>-addr</cite> in the systemd
|
||
service unit <cite>/etc/systemd/system/bngblaster-controller.service</cite>.</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ sudo bngblasterctrl --help
|
||
Usage of bngblasterctrl:
|
||
-addr string
|
||
HTTP network address (default ":8001")
|
||
-color
|
||
turn on color of color output
|
||
-console
|
||
turn on pretty console logging (default true)
|
||
-d string
|
||
config folder (default "/var/bngblaster")
|
||
-debug
|
||
turn on debug logging
|
||
-e string
|
||
bngblaster executable (default "/usr/sbin/bngblaster")
|
||
</pre></div>
|
||
</div>
|
||
</section>
|
||
<section id="api">
|
||
<h2>API<a class="headerlink" href="#api" title="Link to this heading"></a></h2>
|
||
<p>OpenAPI: <a class="reference external" href="https://rtbrick.github.io/bngblaster-controller/">https://rtbrick.github.io/bngblaster-controller/</a></p>
|
||
<section id="create-test-instance">
|
||
<h3>Create Test Instance<a class="headerlink" href="#create-test-instance" title="Link to this heading"></a></h3>
|
||
<p><cite>PUT /api/v1/instances/<instance-name></cite></p>
|
||
<p>This API endpoint creates a test instance if not already created. The body of this request
|
||
is stored as bngblaster configuration (<cite>config.json</cite>).</p>
|
||
<p>Each test instance creates a directory in <cite>/var/bngblaster/<instance-name></cite>.
|
||
This directory contains the following files:</p>
|
||
<ul class="simple">
|
||
<li><p><cite>config.json</cite>: bngblaster configuration</p></li>
|
||
<li><p><cite>run.pid</cite>: bngblaster process ID (if running)</p></li>
|
||
<li><p><cite>run.json</cite>: bngblaster arguments</p></li>
|
||
<li><p><cite>run.log</cite>: bngblaster log file (if enabled)</p></li>
|
||
<li><p><cite>run_report.json</cite>: bngblaster report (if enabled)</p></li>
|
||
<li><p><cite>run.pcap</cite>: bngblaster traffic capture (if enabled)</p></li>
|
||
<li><p><cite>run.sock</cite>: bngblaster control socket</p></li>
|
||
<li><p><cite>run.stderr</cite>: bngblaster standard error</p></li>
|
||
<li><p><cite>run.stdout</cite>: bngblaster standard output</p></li>
|
||
</ul>
|
||
<p>Example:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>curl --location --request PUT 'http://10.10.10.10:8001/api/v1/instances/quickstart_pppoe' \
|
||
--header 'Content-Type: application/json' \
|
||
--data-raw '{
|
||
"interfaces": {
|
||
"a10nsp": [
|
||
{
|
||
"__comment__": "PPPoE Server",
|
||
"interface": "veth1.1"
|
||
}
|
||
],
|
||
"access": [
|
||
{
|
||
"__comment__": "PPPoE Client",
|
||
"interface": "veth1.2",
|
||
"type": "pppoe",
|
||
"outer-vlan-min": 1,
|
||
"outer-vlan-max": 4000,
|
||
"inner-vlan": 7
|
||
}
|
||
]
|
||
}
|
||
}'
|
||
</pre></div>
|
||
</div>
|
||
</section>
|
||
<section id="start-test">
|
||
<h3>Start Test<a class="headerlink" href="#start-test" title="Link to this heading"></a></h3>
|
||
<p><cite>POST /api/v1/instances/<instance-name>/_start</cite></p>
|
||
<p>The start API endpoint will start the bngblaster with the argument options
|
||
defined in the body.</p>
|
||
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
|
||
<span class="w"> </span><span class="nt">"logging"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span>
|
||
<span class="w"> </span><span class="nt">"logging_flags"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span>
|
||
<span class="w"> </span><span class="s2">"debug"</span><span class="p">,</span>
|
||
<span class="w"> </span><span class="s2">"ip"</span>
|
||
<span class="w"> </span><span class="p">],</span>
|
||
<span class="w"> </span><span class="nt">"report"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span>
|
||
<span class="w"> </span><span class="nt">"session_count"</span><span class="p">:</span><span class="w"> </span><span class="mi">1000</span>
|
||
<span class="p">}</span>
|
||
</pre></div>
|
||
</div>
|
||
<p>All supported argument options are explained in the OpenAPI schema.</p>
|
||
<p>Example:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>curl --location --request POST 'http://10.10.10.10:8001/api/v1/instances/quickstart_pppoe/_start' \
|
||
--header 'Content-Type: application/json' \
|
||
--data-raw '{
|
||
"logging": true,
|
||
"logging_flags": [
|
||
"debug",
|
||
"pppoe",
|
||
"ip"
|
||
],
|
||
"report": true,
|
||
"session_count": 2
|
||
}'
|
||
</pre></div>
|
||
</div>
|
||
</section>
|
||
<section id="status">
|
||
<h3>Status<a class="headerlink" href="#status" title="Link to this heading"></a></h3>
|
||
<p><cite>GET /api/v1/instances/<instance-name></cite></p>
|
||
<p>The status API endpoint returns the status of the test which can be either
|
||
<cite>started</cite> or <cite>stopped</cite>.</p>
|
||
</section>
|
||
<section id="command">
|
||
<h3>Command<a class="headerlink" href="#command" title="Link to this heading"></a></h3>
|
||
<p><cite>POST /api/v1/instances/<instance-name>/_command</cite></p>
|
||
<p>The JSON body of this API call will be passed to the bngblaster instance
|
||
control socket (<cite>/var/bngbnlaster/<instance-name>/run.sock</cite>). The result will
|
||
be passed back to the client.</p>
|
||
<p>Example:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>curl --location --request POST 'http://10.10.10.10:8001/api/v1/instances/quickstart_pppoe/_command' \
|
||
--header 'Content-Type: application/json' \
|
||
--data-raw '{
|
||
"command": "session-info",
|
||
"arguments": {
|
||
"session-id": 1
|
||
}
|
||
}'
|
||
</pre></div>
|
||
</div>
|
||
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
|
||
<span class="w"> </span><span class="nt">"status"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ok"</span><span class="p">,</span>
|
||
<span class="w"> </span><span class="nt">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">200</span><span class="p">,</span>
|
||
<span class="w"> </span><span class="nt">"session-info"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
|
||
<span class="w"> </span><span class="nt">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"pppoe"</span><span class="p">,</span>
|
||
<span class="w"> </span><span class="nt">"session-id"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span>
|
||
<span class="w"> </span><span class="nt">"session-state"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Established"</span><span class="p">,</span>
|
||
<span class="w"> </span><span class="nt">"..."</span><span class="p">:</span><span class="w"> </span><span class="s2">"..."</span>
|
||
<span class="w"> </span><span class="p">}</span>
|
||
<span class="p">}</span>
|
||
</pre></div>
|
||
</div>
|
||
<p>The result code is passed as HTTP response status code.</p>
|
||
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
|
||
<span class="w"> </span><span class="nt">"status"</span><span class="p">:</span><span class="w"> </span><span class="s2">"warning"</span><span class="p">,</span>
|
||
<span class="w"> </span><span class="nt">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">404</span><span class="p">,</span>
|
||
<span class="w"> </span><span class="nt">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"session not found"</span>
|
||
<span class="p">}</span>
|
||
</pre></div>
|
||
</div>
|
||
</section>
|
||
<section id="stop-test">
|
||
<h3>Stop Test<a class="headerlink" href="#stop-test" title="Link to this heading"></a></h3>
|
||
<p><cite>POST /api/v1/instances/<instance-name>/_stop</cite></p>
|
||
<p>The stop API endpoint will send the SIGINT signal to the corresponding
|
||
BNG blaster instance (<cite>kill -INT <pid></cite>).</p>
|
||
</section>
|
||
<section id="delete-test-instance">
|
||
<h3>Delete Test Instance<a class="headerlink" href="#delete-test-instance" title="Link to this heading"></a></h3>
|
||
<p><cite>DELETE /api/v1/instances/<instance-name></cite></p>
|
||
<p>This API endpoint deletes the test instance directory. The corresponding
|
||
test run is forcefully terminated (<cite>kill -9 <pid></cite>) if running.</p>
|
||
</section>
|
||
<section id="reports">
|
||
<h3>Reports<a class="headerlink" href="#reports" title="Link to this heading"></a></h3>
|
||
<p>The BNG Blaster can generate detailed <a class="reference internal" href="reports.html#reports"><span class="std std-ref">reports</span></a>
|
||
at the end of the test execution. Those reports must be enabled
|
||
during the start with the argument option <cite>report</cite>. This detailed
|
||
report can be further enhanced using <cite>report_flags</cite> to include
|
||
detailed per-session and stream results. Consider that the resulting
|
||
report may be large if <cite>streams</cite> flag is enabled in combination with
|
||
a huge amount of streams (around 500MB report file for one million streams).</p>
|
||
<p><cite>POST /api/v1/instances/<instance-name>/_start</cite></p>
|
||
<blockquote>
|
||
<div><div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
|
||
<span class="w"> </span><span class="nt">"report"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span>
|
||
<span class="w"> </span><span class="nt">"report_flags"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span>
|
||
<span class="w"> </span><span class="s2">"sessions"</span><span class="p">,</span>
|
||
<span class="w"> </span><span class="s2">"streams"</span>
|
||
<span class="w"> </span><span class="p">]</span>
|
||
<span class="p">}</span>
|
||
</pre></div>
|
||
</div>
|
||
</div></blockquote>
|
||
<p>The final report can be retrieved with the following request
|
||
after the test has finally stopped.</p>
|
||
<p><cite>GET /api/v1/instances/<instance-name>/run_report.json</cite></p>
|
||
<p>After requesting the test to stop, it can take some time until the test
|
||
has gracefully stopped. This can be verified using the status command.
|
||
As soon as the status becomes stopped, the report file should be available.</p>
|
||
</section>
|
||
<section id="logs">
|
||
<h3>Logs<a class="headerlink" href="#logs" title="Link to this heading"></a></h3>
|
||
<p>The BNG Blaster supports extensive <a class="reference internal" href="troubleshooting.html#logging"><span class="std std-ref">logging</span></a>
|
||
during the test execution. This log file must be enabled
|
||
during the start with the argument option <cite>logging</cite>. The optional
|
||
argument <cite>logging_flags</cite> allows for enabling log categories.</p>
|
||
<p><cite>POST /api/v1/instances/<instance-name>/_start</cite></p>
|
||
<blockquote>
|
||
<div><div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
|
||
<span class="w"> </span><span class="nt">"logging"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span>
|
||
<span class="w"> </span><span class="nt">"logging_flags"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span>
|
||
<span class="w"> </span><span class="s2">"bgp"</span><span class="p">,</span>
|
||
<span class="w"> </span><span class="s2">"isis"</span><span class="p">,</span>
|
||
<span class="w"> </span><span class="s2">"ip"</span>
|
||
<span class="w"> </span><span class="p">]</span>
|
||
<span class="p">}</span>
|
||
</pre></div>
|
||
</div>
|
||
</div></blockquote>
|
||
<p>Please check <a class="reference internal" href="troubleshooting.html#logging"><span class="std std-ref">logging</span></a> section for detailed list
|
||
of all logging flags.</p>
|
||
<p>The final log file can be retrieved with the following request
|
||
after the test has finally stopped.</p>
|
||
<p><cite>GET /api/v1/instances/<instance-name>/run.log</cite></p>
|
||
<p>It is also possible to retrieve the standard output and error
|
||
for troubleshooting purposes.</p>
|
||
<p><cite>GET /api/v1/instances/<instance-name>/run.stderr</cite>
|
||
<cite>GET /api/v1/instances/<instance-name>/run.stdout</cite></p>
|
||
</section>
|
||
<section id="pcap">
|
||
<h3>PCAP<a class="headerlink" href="#pcap" title="Link to this heading"></a></h3>
|
||
<p>The BNG Blaster supports to <a class="reference internal" href="troubleshooting.html#capture"><span class="std std-ref">capture</span></a> all traffic
|
||
sent and received by the BNG Blaster which must be enabled during
|
||
the start with the argument option <cite>pcap_capture</cite>.</p>
|
||
<p><cite>POST /api/v1/instances/<instance-name>/_start</cite></p>
|
||
<blockquote>
|
||
<div><div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
|
||
<span class="w"> </span><span class="nt">"pcap_capture"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span>
|
||
<span class="p">}</span>
|
||
</pre></div>
|
||
</div>
|
||
</div></blockquote>
|
||
<p>The final capture file can be retrieved with the following request
|
||
after the test has finally stopped.</p>
|
||
<p><cite>GET /api/v1/instances/<instance-name>/run.pcap</cite></p>
|
||
</section>
|
||
<section id="metrics">
|
||
<h3>Metrics<a class="headerlink" href="#metrics" title="Link to this heading"></a></h3>
|
||
<p><cite>GET /metrics</cite></p>
|
||
<p>This endpoint returns metrics for all instances in Prometheus text format.</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span># HELP instances_running The number of running instances
|
||
# TYPE instances_running gauge
|
||
instances_running{hostname="blaster"} 0
|
||
# HELP instances_total The total number of instances
|
||
# TYPE instances_total gauge
|
||
instances_total{hostname="blaster"} 4
|
||
</pre></div>
|
||
</div>
|
||
<p>The metric <cite>instances_total</cite> counts the number of test instance directories
|
||
present and <cite>instances_running</cite> shows how many of them are running.</p>
|
||
<p>Every metric is labeled with the hostname where the controller is running.</p>
|
||
<p>Per default, there are no metrics per instance. This has to be explicitly
|
||
enabled during instance start (<cite>/api/v1/instances/<instance-name>/_start</cite>)
|
||
using the new <cite>metric_flags</cite> option.</p>
|
||
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
|
||
<span class="w"> </span><span class="nt">"logging"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span>
|
||
<span class="w"> </span><span class="nt">"logging_flags"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span>
|
||
<span class="w"> </span><span class="s2">"error"</span><span class="p">,</span>
|
||
<span class="w"> </span><span class="s2">"ip"</span>
|
||
<span class="w"> </span><span class="p">],</span>
|
||
<span class="w"> </span><span class="nt">"metric_flags"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span>
|
||
<span class="w"> </span><span class="s2">"session_counters"</span><span class="p">,</span>
|
||
<span class="w"> </span><span class="s2">"interfaces"</span>
|
||
<span class="w"> </span><span class="p">]</span>
|
||
<span class="p">}</span>
|
||
</pre></div>
|
||
</div>
|
||
<p>Currently, the following metrics are supported:</p>
|
||
<ul class="simple">
|
||
<li><p><cite>session_counters</cite> session statistics</p></li>
|
||
<li><p><cite>interfaces</cite> interface/link counters</p></li>
|
||
<li><p><cite>access_interfaces</cite> access interface function counters</p></li>
|
||
<li><p><cite>network_interfaces</cite> network interface function counters</p></li>
|
||
<li><p><cite>a10nsp_interfaces</cite> a10nsp interface function counters</p></li>
|
||
<li><p><cite>streams</cite> stream counters</p></li>
|
||
</ul>
|
||
<p>The <cite>streams</cite> metric generates statistics for every stream and direction.
|
||
Therefore the <cite>streams</cite> metric should not be used with massive streams
|
||
(e.g. > 10.000 streams) but there is no limit enforced.</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span># HELP sessions The total number of sessions
|
||
# TYPE sessions counter
|
||
sessions{hostname="blaster",instance_name="test"} 10
|
||
# HELP sessions_established The number of sessions in the state established
|
||
# TYPE sessions_established gauge
|
||
sessions_established{hostname="blaster",instance_name="test"} 10
|
||
...
|
||
</pre></div>
|
||
</div>
|
||
<p>Instance metrics are labeled with the instance name. All interface-specific metrics
|
||
are also labeled with the corresponding interface name and type.</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span># HELP interfaces_rx_packets Interface RX packets
|
||
# TYPE interfaces_rx_packets counter
|
||
interfaces_rx_packets{hostname="rbfs",instance_name="test",interface_name="eth1",interface_type="Interface"} 163
|
||
interfaces_rx_packets{hostname="rbfs",instance_name="test",interface_name="eth11",interface_type="Network"} 155
|
||
interfaces_rx_packets{hostname="rbfs",instance_name="test",interface_name="eth12",interface_type="Interface"} 158
|
||
interfaces_rx_packets{hostname="rbfs",instance_name="test",interface_name="eth12",interface_type="Access"} 150
|
||
...
|
||
</pre></div>
|
||
</div>
|
||
</section>
|
||
</section>
|
||
</section>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
|
||
<a href="api/index.html" class="btn btn-neutral float-left" title="API/CLI" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
|
||
<a href="performance.html" class="btn btn-neutral float-right" title="Performance Guide" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
|
||
</div>
|
||
|
||
<hr/>
|
||
|
||
<div role="contentinfo">
|
||
<p>© Copyright 2020-2024, RtBrick, Inc..</p>
|
||
</div>
|
||
|
||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
||
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
||
|
||
|
||
</footer>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
</div>
|
||
<script>
|
||
jQuery(function () {
|
||
SphinxRtdTheme.Navigation.enable(true);
|
||
});
|
||
</script>
|
||
|
||
</body>
|
||
</html> |