Skip to content

Commit

Permalink
Release 25.225.0
Browse files Browse the repository at this point in the history
  • Loading branch information
apamabld committed Aug 20, 2024
1 parent f51e8fa commit 9a2940b
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 31 deletions.
82 changes: 56 additions & 26 deletions _modules/apamax/eplapplications/basetest.html

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion _modules/apamax/eplapplications/perf/basetest.html
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,10 @@ <h1>Source code for apamax.eplapplications.perf.basetest</h1><div class="highlig
<span class="n">slope_ratio</span> <span class="o">=</span> <span class="nb">float</span><span class="p">(</span><span class="s2">&quot;inf&quot;</span><span class="p">)</span>

<span class="c1"># if slope is not coming down fast enough then most probably queue is going to get full</span>
<span class="n">mean_size_towards_end</span> <span class="o">=</span> <span class="n">statistics</span><span class="o">.</span><span class="n">mean</span><span class="p">(</span><span class="n">values</span><span class="p">[</span><span class="nb">int</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">values</span><span class="p">)</span> <span class="o">*</span> <span class="mf">0.85</span><span class="p">)</span> <span class="p">:</span> <span class="nb">int</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">values</span><span class="p">)</span> <span class="o">*</span> <span class="mf">0.95</span><span class="p">)])</span>
<span class="n">end_values</span> <span class="o">=</span> <span class="n">values</span><span class="p">[</span><span class="nb">int</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">values</span><span class="p">)</span> <span class="o">*</span> <span class="mf">0.85</span><span class="p">)</span> <span class="p">:</span> <span class="nb">int</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">values</span><span class="p">)</span> <span class="o">*</span> <span class="mf">0.95</span><span class="p">)]</span> <span class="c1"># portion of last 15% values</span>
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">end_values</span><span class="p">)</span> <span class="o">&lt;</span> <span class="mi">2</span><span class="p">:</span> <span class="c1"># use last 2 values if the portion contains less than 2 values</span>
<span class="n">end_values</span> <span class="o">=</span> <span class="n">values</span><span class="p">[</span><span class="o">-</span><span class="mi">2</span><span class="p">:]</span>
<span class="n">mean_size_towards_end</span> <span class="o">=</span> <span class="n">statistics</span><span class="o">.</span><span class="n">mean</span><span class="p">(</span><span class="n">end_values</span><span class="p">)</span>
<span class="k">if</span> <span class="n">slope_ratio</span> <span class="o">&gt;</span> <span class="n">ratio_threshold</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">log</span><span class="o">.</span><span class="n">error</span><span class="p">(</span><span class="sa">f</span><span class="s1">&#39;Correlator </span><span class="si">{</span><span class="n">queue_name</span><span class="si">}</span><span class="s1"> queue was increasing continuously. It probably would have been full eventually. Mean queue size towards the end was </span><span class="si">{</span><span class="n">mean_size_towards_end</span><span class="si">}</span><span class="s1">&#39;</span><span class="p">)</span>
<span class="k">elif</span> <span class="n">slope_ratio</span> <span class="o">&gt;</span> <span class="mf">0.2</span><span class="p">:</span>
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ <h2>Introduction<a class="headerlink" href="#introduction" title="Permalink to t
you to script uploads of your EPL apps and manage them for CI/CD use cases.
It also provides extensions to the PySys test framework to allow you
to simply write tests for your EPL apps and to run them automatically.</p>
<p>See <a class="reference external" href="https://documentation.softwareag.com/pam/10.15.4/en">Apama Documentation</a> and <a class="reference external" href="https://cumulocity.com/docs/streaming-analytics">Streaming Analytics guide</a> for further docs.
<p>See <a class="reference external" href="https://documentation.softwareag.com/pam/10.15.5/en">Apama Documentation</a> and <a class="reference external" href="https://cumulocity.com/docs/streaming-analytics">Streaming Analytics guide</a> for further docs.
See <a class="reference external" href="https://github.com/SoftwareAG/apama-eplapps-tools">apama-eplapps-tools</a> for the main GitHub repository.</p>
</div>
<div class="section" id="contents">
Expand Down
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions testing-epl.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ <h2>Introduction<a class="headerlink" href="#introduction" title="Permalink to t
<span class="p">}</span>
</pre></div>
</div>
<p>This action initializes a <code class="docutils literal notranslate"><span class="pre">ManagedObject</span></code> (using the “PYSYS_” naming prefix and adding the <code class="docutils literal notranslate"><span class="pre">c8y_IsDevice</span></code> property), before sending it using a <code class="docutils literal notranslate"><span class="pre">withResponse</span></code> action. It then confirms that it has been successfully created using listeners for <code class="docutils literal notranslate"><span class="pre">ObjectCommitted</span></code> and <code class="docutils literal notranslate"><span class="pre">ObjectCommitFailed</span></code> events. Whenever you are creating or updating an object in Cumulocity IoT and you want to verify that the change has been successful, it is recommended that you use the <code class="docutils literal notranslate"><span class="pre">withResponse</span></code> action in conjunction with <code class="docutils literal notranslate"><span class="pre">ObjectCommitted</span></code> and <code class="docutils literal notranslate"><span class="pre">ObjectCommitFailed</span></code> listeners (for more information, see the information on updating a managed object in the ‘The Cumulocity IoT Transport Connectivity Plug-in’ section of the <a class="reference external" href="https://documentation.softwareag.com/pam/10.15.4/en/webhelp/pam-webhelp/index.html#page/pam-webhelp%2Fco-ConApaAppToExtCom_the_cumulocity_connectivity_plug_in.html">documentation</a>). Using this approach you can easily relay when the process has completed (which is done by sending an event, <code class="docutils literal notranslate"><span class="pre">DeviceCreated</span></code>, in the example above), and in the event of an error you can cause the test to exit quickly.</p>
<p>This action initializes a <code class="docutils literal notranslate"><span class="pre">ManagedObject</span></code> (using the “PYSYS_” naming prefix and adding the <code class="docutils literal notranslate"><span class="pre">c8y_IsDevice</span></code> property), before sending it using a <code class="docutils literal notranslate"><span class="pre">withResponse</span></code> action. It then confirms that it has been successfully created using listeners for <code class="docutils literal notranslate"><span class="pre">ObjectCommitted</span></code> and <code class="docutils literal notranslate"><span class="pre">ObjectCommitFailed</span></code> events. Whenever you are creating or updating an object in Cumulocity IoT and you want to verify that the change has been successful, it is recommended that you use the <code class="docutils literal notranslate"><span class="pre">withResponse</span></code> action in conjunction with <code class="docutils literal notranslate"><span class="pre">ObjectCommitted</span></code> and <code class="docutils literal notranslate"><span class="pre">ObjectCommitFailed</span></code> listeners (for more information, see the information on updating a managed object in the ‘The Cumulocity IoT Transport Connectivity Plug-in’ section of the <a class="reference external" href="https://documentation.softwareag.com/pam/10.15.5/en/webhelp/pam-webhelp/index.html#page/pam-webhelp%2Fco-ConApaAppToExtCom_the_cumulocity_connectivity_plug_in.html">documentation</a>). Using this approach you can easily relay when the process has completed (which is done by sending an event, <code class="docutils literal notranslate"><span class="pre">DeviceCreated</span></code>, in the example above), and in the event of an error you can cause the test to exit quickly.</p>
</div>
<div class="section" id="sending-events-to-your-epl-apps">
<h2>Sending events to your EPL apps<a class="headerlink" href="#sending-events-to-your-epl-apps" title="Permalink to this headline"></a></h2>
Expand Down Expand Up @@ -170,7 +170,7 @@ <h2>Receiving events from your EPL apps<a class="headerlink" href="#receiving-ev
</div>
<div class="section" id="querying-cumulocity-iot">
<h2>Querying Cumulocity IoT<a class="headerlink" href="#querying-cumulocity-iot" title="Permalink to this headline"></a></h2>
<p>An alternative approach to the one demonstrated in the ‘<a class="reference internal" href="#receiving-events-from-your-epl-apps">Receiving events from your EPL apps</a>’ section involves querying Cumulocity IoT. With this approach you are able to retrieve historical data. It is possible to query Cumulocity IoT for alarms, events, measurements, operations, and managed objects. More information on querying can be found in ‘The Cumulocity IoT Transport Connectivity Plug-in’ section of the <a class="reference external" href="https://documentation.softwareag.com/pam/10.15.4/en/webhelp/pam-webhelp/index.html#page/pam-webhelp%2Fco-ConApaAppToExtCom_the_cumulocity_connectivity_plug_in.html">documentation</a>.</p>
<p>An alternative approach to the one demonstrated in the ‘<a class="reference internal" href="#receiving-events-from-your-epl-apps">Receiving events from your EPL apps</a>’ section involves querying Cumulocity IoT. With this approach you are able to retrieve historical data. It is possible to query Cumulocity IoT for alarms, events, measurements, operations, and managed objects. More information on querying can be found in ‘The Cumulocity IoT Transport Connectivity Plug-in’ section of the <a class="reference external" href="https://documentation.softwareag.com/pam/10.15.5/en/webhelp/pam-webhelp/index.html#page/pam-webhelp%2Fco-ConApaAppToExtCom_the_cumulocity_connectivity_plug_in.html">documentation</a>.</p>
<p>Using an example of a test that checks for an alarm, this would involve subscribing to the <code class="docutils literal notranslate"><span class="pre">FindAlarmResponse.SUBSCRIBE_CHANNEL</span></code> and using a <code class="docutils literal notranslate"><span class="pre">FindAlarm</span></code> event with <code class="docutils literal notranslate"><span class="pre">FindAlarmResponse</span></code> and <code class="docutils literal notranslate"><span class="pre">FindAlarmResponseAck</span></code> listeners:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">on</span> <span class="n">DeviceCreated</span><span class="p">(</span><span class="n">reqId</span><span class="o">=</span><span class="n">createNewDevice</span><span class="p">(</span><span class="s2">&quot;DeviceSimulator&quot;</span><span class="p">))</span> <span class="k">as</span> <span class="n">device</span>
<span class="p">{</span>
Expand Down
14 changes: 14 additions & 0 deletions using-pysys.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,19 @@ <h2>Testing locally<a class="headerlink" href="#testing-locally" title="Permalin
</pre></div>
</div>
<p>Setting which EPL app to run the test on works as before.</p>
<div class="section" id="notifications-2-0">
<h3>Notifications 2.0<a class="headerlink" href="#notifications-2-0" title="Permalink to this headline"></a></h3>
<p>The EPL apps test framework supports using the new Notifications 2.0 API for receiving notifications from Cumulocity IoT. By default, this is disabled.</p>
<p>See <a class="reference external" href="https://documentation.softwareag.com/pam/10.15.5/en/webhelp/pam-webhelp/#page/pam-webhelp%2Fco-ApaRelNot_10155_iot_bundles.html">the release note</a> for more information about the Notifications 2.0 integration.</p>
<p>To enable it within the EPL apps test framework, add the following elements to your PySys Project XML:</p>
<div class="highlight-xml notranslate"><div class="highlight"><pre><span></span><span class="c">&lt;!-- Whether Notifications 2.0 is enabled. By default, it is disabled. --&gt;</span>
<span class="nt">&lt;property</span> <span class="na">name=</span><span class="s">&quot;CUMULOCITY_NOTIFICATIONS_2&quot;</span> <span class="na">value=</span><span class="s">&quot;${env.CUMULOCITY_NOTIFICATIONS_2}&quot;</span> <span class="na">default=</span><span class="s">&quot;true&quot;</span> <span class="nt">/&gt;</span>

<span class="c">&lt;!-- The Cumulocity Notifications 2.0 Service URL --&gt;</span>
<span class="nt">&lt;property</span> <span class="na">name=</span><span class="s">&quot;CUMULOCITY_NOTIFICATIONS_SERVICE_URL&quot;</span> <span class="na">value=</span><span class="s">&quot;${env.CUMULOCITY_NOTIFICATIONS_SERVICE_URL}&quot;</span> <span class="na">default=</span><span class="s">&quot;pulsar://pulsar-proxy&quot;</span> <span class="nt">/&gt;</span>
</pre></div>
</div>
</div>
<div class="section" id="id2">
<h3>Running the test<a class="headerlink" href="#id2" title="Permalink to this headline"></a></h3>
<p>To run the test using a local correlator requires the APAMA_HOME project property to be set as the path to your installation of Apama. This can be done by simply running the test in an Apama command prompt or by explicitly setting the APAMA_HOME environment variable.</p>
Expand Down Expand Up @@ -240,6 +253,7 @@ <h3><a href="index.html">Table of Contents</a></h3>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#testing-locally">Testing locally</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#notifications-2-0">Notifications 2.0</a></li>
<li class="toctree-l3"><a class="reference internal" href="#id2">Running the test</a></li>
</ul>
</li>
Expand Down

0 comments on commit 9a2940b

Please sign in to comment.