Skip to content

Commit

Permalink
Apama Analytics EPL Apps tools for
Browse files Browse the repository at this point in the history
  • Loading branch information
SudhaJalluu committed Oct 27, 2022
1 parent fb68204 commit 980f0e2
Show file tree
Hide file tree
Showing 40 changed files with 143 additions and 147 deletions.
10 changes: 5 additions & 5 deletions doc/performance-testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ An EPL app or a smart rule can be either tested against real devices or simulate
+ Generating the performance reports.
+ Writing a test for a multi-tenant microservice.

This document demonstrates the common process involved in writing a performance test for your existing EPL apps and smart rules. The performance tests described in the document use the EPL apps SDK based on the PySys test framework. See the `PySys documentation <https://pysys-test.github.io/pysys-test/>`_ for details on the installation, and how the framework can be used and the facilities it contains. Set up the EPL apps SDK by following the steps mentioned in :ref:`Setup for testing in the Cumulocity IoT cloud <setup-for-test-in-cloud>`.
This document demonstrates the common process involved in writing a performance test for your existing EPL apps and smart rules. The performance tests described in the document use the EPL apps SDK based on the PySys test framework. See the `PySys documentation <https://pysys-test.github.io/pysys-test>`_ for details on the installation, and how the framework can be used and the facilities it contains. Set up the EPL apps SDK by following the steps mentioned in `Testing in the Cumulocity IoT cloud <using-pysys.rst#testing-in-the-cumulocity-iot-cloud>`_.

Writing a performance test
===========================
Expand Down Expand Up @@ -72,7 +72,7 @@ Once the default value is defined with a static attribute, you can override the
pysys run -XmyTestDuration=10 -XmeasurementType="MyMeasurement"
See the `PySys test options <https://pysys-test.github.io/pysys-test/UserGuide.html#configuring-and-overriding-test-options>`_ in the PySys documentation for details on configuring and overriding test options.
See the `PySys test options <https://pysys-test.github.io/pysys-test/pysys/UserGuide.html#configuring-and-overriding-test-options>`_ in the PySys documentation for details on configuring and overriding test options.

Preparing the Cumulocity IoT tenant
------------------------------------
Expand Down Expand Up @@ -408,7 +408,7 @@ See the OnExplicitThresholdCreateAlarm_MultiTenant sample in the smartrules-perf

Running the performance test
=============================
Performance tests can only be run using a Cumulocity IoT tenant with EPL apps and smart rules enabled. Set up the framework to use a Cumulocity IoT tenant by following the steps mentioned in :ref:`Setup for testing in the Cumulocity IoT cloud <setup-for-test-in-cloud>`.
Performance tests can only be run using a Cumulocity IoT tenant with EPL apps and smart rules enabled. Set up the framework to use a Cumulocity IoT tenant by following the steps mentioned in `Testing in the Cumulocity IoT cloud <using-pysys.rst#testing-in-the-cumulocity-iot-cloud>`_.

When running a test, test options can be overridden by using the ``-X`` argument. See `Defining the test options`_ for details on defining and providing test options.

Expand All @@ -418,7 +418,7 @@ For example, to change the test duration of the ``AlarmOnThreshold`` test, run t
pysys run -XtestDuration=180 AlarmOnThreshold
At the end of the test, a basic validation of the test run is performed. See `PySys helpers <https://SoftwareAG.github.io/apama-eplapps-tools/doc/pydoc/>`_ in the EPL Apps Tools documentation for details on validations performed.
At the end of the test, a basic validation of the test run is performed. See `PySys helpers <https://softwareag.github.io/apama-eplapps-tools/doc/pydoc/>`_ in the EPL Apps Tools documentation for details on validations performed.


Performance report
Expand Down Expand Up @@ -470,7 +470,7 @@ Multiple sample EPL apps and tests can be found in the samples-performance direc
| +-----correctness/
| +-----performance/
The apps directory contains multiple sample apps for performance testing. The correctness directory contains basic correctness tests of the sample apps. It is recommended to always test your EPL apps for correctness before testing them for performance. See :doc:`Using PySys to test your EPL apps <using-pysys>` for details on testing EPL apps for correctness. The performance directory contains performance tests for each sample app. These tests can be run as explained in `Running the performance test`_.
The apps directory contains multiple sample apps for performance testing. The correctness directory contains basic correctness tests of the sample apps. It is recommended to always test your EPL apps for correctness before testing them for performance. See `Using PySys to test your EPL apps <using-pysys.rst#using-pysys-to-test-your-epl-apps>`_ for details on testing EPL apps for correctness. The performance directory contains performance tests for each sample app. These tests can be run as explained in `Running the performance test`_.

Sample smart rule performance tests
===================================
Expand Down
6 changes: 3 additions & 3 deletions doc/pydoc/_modules/apamax/eplapplications/basetest.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<title>apamax.eplapplications.basetest &#8212; EPL Apps Tools 10.14.0.3 documentation</title>
<title>apamax.eplapplications.basetest &#8212; EPL Apps Tools 10.15.0.2 documentation</title>
<link rel="stylesheet" href="../../../_static/classic.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />

Expand All @@ -26,7 +26,7 @@ <h3>Navigation</h3>
<li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">EPL Apps Tools 10.14.0.3 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">EPL Apps Tools 10.15.0.2 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" accesskey="U">Module code</a> &#187;</li>
</ul>
</div>
Expand Down Expand Up @@ -676,7 +676,7 @@ <h3>Navigation</h3>
<li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">EPL Apps Tools 10.14.0.3 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">EPL Apps Tools 10.15.0.2 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" >Module code</a> &#187;</li>
</ul>
</div>
Expand Down
6 changes: 3 additions & 3 deletions doc/pydoc/_modules/apamax/eplapplications/connection.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<title>apamax.eplapplications.connection &#8212; EPL Apps Tools 10.14.0.3 documentation</title>
<title>apamax.eplapplications.connection &#8212; EPL Apps Tools 10.15.0.2 documentation</title>
<link rel="stylesheet" href="../../../_static/classic.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />

Expand All @@ -26,7 +26,7 @@ <h3>Navigation</h3>
<li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">EPL Apps Tools 10.14.0.3 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">EPL Apps Tools 10.15.0.2 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" accesskey="U">Module code</a> &#187;</li>
</ul>
</div>
Expand Down Expand Up @@ -177,7 +177,7 @@ <h3>Navigation</h3>
<li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">EPL Apps Tools 10.14.0.3 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">EPL Apps Tools 10.15.0.2 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" >Module code</a> &#187;</li>
</ul>
</div>
Expand Down
6 changes: 3 additions & 3 deletions doc/pydoc/_modules/apamax/eplapplications/eplapps.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<title>apamax.eplapplications.eplapps &#8212; EPL Apps Tools 10.14.0.3 documentation</title>
<title>apamax.eplapplications.eplapps &#8212; EPL Apps Tools 10.15.0.2 documentation</title>
<link rel="stylesheet" href="../../../_static/classic.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />

Expand All @@ -26,7 +26,7 @@ <h3>Navigation</h3>
<li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">EPL Apps Tools 10.14.0.3 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">EPL Apps Tools 10.15.0.2 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" accesskey="U">Module code</a> &#187;</li>
</ul>
</div>
Expand Down Expand Up @@ -274,7 +274,7 @@ <h3>Navigation</h3>
<li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">EPL Apps Tools 10.14.0.3 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">EPL Apps Tools 10.15.0.2 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" >Module code</a> &#187;</li>
</ul>
</div>
Expand Down
8 changes: 4 additions & 4 deletions doc/pydoc/_modules/apamax/eplapplications/perf/basetest.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<title>apamax.eplapplications.perf.basetest &#8212; EPL Apps Tools 10.14.0.3 documentation</title>
<title>apamax.eplapplications.perf.basetest &#8212; EPL Apps Tools 10.15.0.2 documentation</title>
<link rel="stylesheet" href="../../../../_static/classic.css" type="text/css" />
<link rel="stylesheet" href="../../../../_static/pygments.css" type="text/css" />

Expand All @@ -26,7 +26,7 @@ <h3>Navigation</h3>
<li class="right" >
<a href="../../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../../index.html">EPL Apps Tools 10.14.0.3 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="../../../../index.html">EPL Apps Tools 10.15.0.2 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../../index.html" accesskey="U">Module code</a> &#187;</li>
</ul>
</div>
Expand Down Expand Up @@ -179,7 +179,7 @@ <h1>Source code for apamax.eplapplications.perf.basetest</h1><div class="highlig
<span class="c1"># Stop monitoring thread</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">perfMonitorThread</span><span class="p">:</span>
<span class="c1"># Do not stop perf monitoring thread if testing against multi-tenant microservice</span>
<span class="c1"># and tenant is specified explicitly, because we need to monitor all tenants at once.</span>
<span class="c1"># and tenant is specified explicitly. because we need to monitor all tenants at once.</span>
<span class="k">if</span> <span class="ow">not</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">platform</span><span class="o">.</span><span class="n">isMultiTenantMicroservice</span><span class="p">()</span> <span class="ow">and</span> <span class="n">tenant</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">perfMonitorThread</span><span class="o">.</span><span class="n">stop</span><span class="p">()</span>
<span class="bp">self</span><span class="o">.</span><span class="n">perfMonitorThread</span><span class="o">.</span><span class="n">join</span><span class="p">()</span>
Expand Down Expand Up @@ -1157,7 +1157,7 @@ <h3>Navigation</h3>
<li class="right" >
<a href="../../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../../index.html">EPL Apps Tools 10.14.0.3 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="../../../../index.html">EPL Apps Tools 10.15.0.2 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../../index.html" >Module code</a> &#187;</li>
</ul>
</div>
Expand Down
12 changes: 5 additions & 7 deletions doc/pydoc/_modules/apamax/eplapplications/platform.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<title>apamax.eplapplications.platform &#8212; EPL Apps Tools 10.14.0.3 documentation</title>
<title>apamax.eplapplications.platform &#8212; EPL Apps Tools 10.15.0.2 documentation</title>
<link rel="stylesheet" href="../../../_static/classic.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />

Expand All @@ -26,7 +26,7 @@ <h3>Navigation</h3>
<li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">EPL Apps Tools 10.14.0.3 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">EPL Apps Tools 10.15.0.2 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" accesskey="U">Module code</a> &#187;</li>
</ul>
</div>
Expand Down Expand Up @@ -123,10 +123,8 @@ <h1>Source code for apamax.eplapplications.platform</h1><div class="highlight"><
<span class="n">instances</span> <span class="o">=</span> <span class="p">{}</span>
<span class="k">try</span><span class="p">:</span>
<span class="k">while</span> <span class="nb">len</span><span class="p">(</span><span class="n">instances</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
<span class="n">res</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_c8yConn</span><span class="o">.</span><span class="n">do_get</span><span class="p">(</span><span class="s2">&quot;/inventory/managedObjects?type=c8y_Application_</span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="bp">self</span><span class="o">.</span><span class="n">_applicationId</span><span class="p">)</span>
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">res</span><span class="p">[</span><span class="s2">&quot;managedObjects&quot;</span><span class="p">])</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
<span class="k">break</span> <span class="c1"># this means we got the wrong one</span>
<span class="n">instances</span> <span class="o">=</span> <span class="n">res</span><span class="p">[</span><span class="s2">&quot;managedObjects&quot;</span><span class="p">][</span><span class="mi">0</span><span class="p">][</span><span class="s2">&quot;c8y_Subscriptions&quot;</span><span class="p">][</span><span class="bp">self</span><span class="o">.</span><span class="n">_remoteTenantId</span><span class="p">][</span><span class="s2">&quot;instances&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">keys</span><span class="p">()</span>
<span class="n">applicationStatus</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_c8yConn</span><span class="o">.</span><span class="n">do_get</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;/application/applications/</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">_applicationId</span><span class="si">}</span><span class="s2">/status?refresh=true&quot;</span><span class="p">)</span>
<span class="n">instances</span> <span class="o">=</span> <span class="n">applicationStatus</span><span class="p">[</span><span class="s1">&#39;c8y_Status&#39;</span><span class="p">][</span><span class="s1">&#39;instances&#39;</span><span class="p">]</span>
<span class="n">time</span><span class="o">.</span><span class="n">sleep</span><span class="p">(</span><span class="mf">1.0</span><span class="p">)</span>
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">instances</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_instanceName</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">instances</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
Expand Down Expand Up @@ -302,7 +300,7 @@ <h3>Navigation</h3>
<li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">EPL Apps Tools 10.14.0.3 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">EPL Apps Tools 10.15.0.2 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" >Module code</a> &#187;</li>
</ul>
</div>
Expand Down
6 changes: 3 additions & 3 deletions doc/pydoc/_modules/apamax/eplapplications/smartrules.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<title>apamax.eplapplications.smartrules &#8212; EPL Apps Tools 10.14.0.3 documentation</title>
<title>apamax.eplapplications.smartrules &#8212; EPL Apps Tools 10.15.0.2 documentation</title>
<link rel="stylesheet" href="../../../_static/classic.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />

Expand All @@ -26,7 +26,7 @@ <h3>Navigation</h3>
<li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">EPL Apps Tools 10.14.0.3 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">EPL Apps Tools 10.15.0.2 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" accesskey="U">Module code</a> &#187;</li>
</ul>
</div>
Expand Down Expand Up @@ -834,7 +834,7 @@ <h3>Navigation</h3>
<li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">EPL Apps Tools 10.14.0.3 documentation</a> &#187;</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">EPL Apps Tools 10.15.0.2 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" >Module code</a> &#187;</li>
</ul>
</div>
Expand Down
Loading

0 comments on commit 980f0e2

Please sign in to comment.