What is the best way to test the robustness of ajaxterm(J) JavaScript's heartbeat functionality

Currently, my setup involves utilizing AjaxtermJ (a Java version of Ajaxterm). The Ajaxterm client-side includes a javascript function that consistently sends heartbeats to the server every second, regardless of user interaction.

In order to optimize the performance of the server, I am interested in stress testing it. However, I have not yet come across a straightforward method to replicate this action.

HtmlUnit does offer some level of headless javascript support, but from my experience, it falls short when attempting to simulate this specific behavior. I am curious if there are more advanced and updated tools available nowadays to simplify this process, especially considering the prevalence of javascript-heavy clients.

While I could develop custom java code for JMeter that initiates a thread responsible for sending heartbeats every second, I would prefer to explore alternative solutions before pursuing such an approach.

On a side note, it's important to clarify that I am not seeking software recommendations (acknowledging the rules). Although, it is plausible that a particular framework may provide the solution. My primary query revolves around how I can emulate this behavior during a stress test.

Answer №1

Within your application, each client seems to be causing a dual impact on the Web server: user typing actions (A) and heartbeats (B). To effectively stress test this, you will need to simulate two corresponding test cases running asynchronously. Any robust load testing tool that supports multiple test cases, pacing, and simple test case recording / editing should be able to handle this situation. Here is how I would approach testing this in our StresStimulus tool:

  1. Record user actions to create test case A.
  2. Duplicate test case A to form test case B.
  3. In test case A, remove all heartbeat requests.
  4. In test case B, delete all requests except for a single heartbeat request.
  5. For test case B, adjust the "delay after test case" setting to "Pacing" and set the minimum duration of the test case replay to 1 second, as depicted in the screenshot.

Following this setup, you can customize the load based on your stress testing needs. Ensure that test cases A and B are executed by an equal number of virtual users. For instance, to mimic a step load ranging from 1 to 100 virtual users, set up a step load from 2 to 200 VUs with 50% of VUs assigned to each test case. This way, test case B will accurately simulate heartbeats while test case A handles user typing activities, regardless of the number of VUs involved.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Filtering Dropdown List in AngularJS with a Text Input Field and a Submit Button for Filtering Option Values

After exploring , I discovered a feature that enables users to type in a text box and filter results in a pseudo-dropdown. My goal is to enhance this functionality or come up with a better approach for users to type and filter select box options, ultimate ...

Experiencing a RepositoryNotFoundError in TypeORM, although I am confident that the repositories are properly registered

I am creating a new application using Next.js + TypeORM and encountering an issue with the integration. RepositoryNotFoundError: No repository for "User" was found. It seems like this entity is not registered in the current "default" connection? Althoug ...

To achieve two-way binding with a scope variable, it is necessary to enclose it within an

I am in need of creating a basic search feature for some items. I have designed a simple control with a button that clears the search query: <div class="item item-input item-button-right"> <i class="icon ion-ios-search placeholder-icon">&l ...

Is AJAX necessary for this task or is there a simpler alternative available?

Just starting out with PHP and currently working on a task that involves handling two queries using an onclick function. One query is supposed to display rows from a table ordered by rate when clicking "Best rate", and the other should order them by date c ...

Using PHP to generate hyperlink onclick events with jQuery

I am currently dealing with some messy PHP code that needs to be cleaned up at a later time. However, the priority now is to get the code functioning properly. Currently, the post command is not executing, meaning that the script find.php is not being ru ...

Please provide links to both the image and text within a Rails 3.1 application

Hey there! I have a small piece of code and I'm wondering how to add a link to both the icon and text. I am calling an icon from a class. Check out my code below: <td class="cv-class_<%= index + 1 %>"> <a onClick="ad ...

I encountered an error while attempting to import a file into Firebase Storage

I've been struggling to upload files from Firebase Storage and encountering errors despite reading the documentation and various blogs on the topic. I'm looking for the most effective approach to resolve this issue. import { storage } from ' ...

Transform the JSON format received from the API endpoint to make it suitable for use in the component

I'm working on a react-native app that fetches event data from a wordpress endpoint. Below is the JSON I receive from the wordpress API. How can I restructure it to fit into my calendar component? Where should I handle this restructuring in my app? ...

Customize nestjs/crud response

For this particular project, I am utilizing the Nest framework along with the nestjs/crud library. Unfortunately, I have encountered an issue where I am unable to override the createOneBase function in order to return a personalized response for a person e ...

javascript close the current browser tab

Can someone please help me with a JavaScript code to close the current window? I have tried the following code but it does not seem to work: <input type="button" class="btn btn-success" style="font-weight: b ...

trigger the focusout event within the focusin event

I am attempting to trigger the focusout event within the focusin event because I need to access the previous value from the focusin event, but the focusout event is being triggered multiple times. $('tr #edituser').focusin(function(){ var ...

Is there a way to store the JWT response header retrieved with fetch?

I am currently utilizing React and employing fetch to send a request to the server: fetch("http://localhost:8001/api/login", { method: 'post', headers: { "Content-type": "application/x-www-form-urlencoded; charset=UTF-8" }, ...

Print custom jQuery attribute to console or log output

I need help retrieving and displaying a custom jQuery attribute in either an alert or console. Despite attempting to use console.log() to access my custom data attribute, I am unable to see its value appear. The specific value I am trying to display is d ...

Filter your data in jQuery DataTables using individual filters for each column

I'm currently working on a DataTables table that pulls data from an AJAX source. I have successfully set up the table and made searching functional. However, I've been asked to add search fields for each column. I found a DataTables Plugin for c ...

Searching for a specific sequence of characters within an array

I have been working on a versatile function that can perform various tasks related to finding a specific value in a list or array. Below is the code I have come up with: function findInArray(needle, arr, exact, sensitive) { if (needle && arr) { ...

In jQuery, turn off the hover function while the animation is in progress

I've implemented this jQuery animation: $('.menu1').stop().animate({left: "29%", top: '2%', width:'40%', fontSize: '60%'}, 3000); $('.menu2').stop().animate({left: "44%", top: &apo ...

How can I pass a PHP variable to a JavaScript variable using PHP and JQuery/JavaScript?

I am facing a challenge with a large <select> input that is used across multiple pages. My idea is to separate this dropdown box into its own PHP file and load it externally using JQuery. Is this approach feasible? Here's an outline of what I ha ...

Retrieving a MAC address from a device using a web script or HTTP protocol

Is it feasible, with access to all end user devices, to request the device's MAC address using web scripting in Apache/IIS/Nginx? Would PHP, Perl, or ASP be able to accomplish this task? The client devices run on iOS, so the method described here wil ...

JSON object containing elements with dash (-) character in their names

While I am in the process of parsing a `json` object, I encountered an element labeled as `data-config`. Here's an example: var video = data.element.data-config; Every time I attempt to parse this specific element, an error pops up: ReferenceError ...

Displaying a certain div when clicked within a loop using Vue.js and Laravel

I am currently facing an issue with displaying a hidden div upon click. The problem arises when using a loop to dynamically generate all the divs. Whenever I click the button, it shows all the divs instead of just one specific div on each click. I attempte ...