flexivian / flexbench Goto Github PK
View Code? Open in Web Editor NEWThis project forked from iskitsas/http-traffic-simulator
A nodejs http traffic simulator
This project forked from iskitsas/http-traffic-simulator
A nodejs http traffic simulator
1st time opening the app, the user should get a prompt to create a project, under which he will create his test scenarios
Multiple projects can be created, the user should select a project, find all scenarios, select a scenario to edit/run, or create a new scenario
Supported options for a scenario:
Locate the file heavy-load.js and implement a heavy (http) load scenario using flexbench
Since it is a http traffic simulator having the frontend on Flutter desktops, it is best to start early with flutter and keep adding the required features later down the line. I will get started with setting up Flutter environment right away.
You can check the rest from my pr.
Inside the runTest function when tried to terminate the test with condition, the stop() function is not terminating the test
To reproduce this issue below is the code for runTest()
function runTest() {
trafficSimulator.debugMode(true);
trafficSimulator.testDuration(-1);//-1 for infinite run
trafficSimulator.workers(4);
trafficSimulator.clients(2)
trafficSimulator.throttleRequests_bps(50000);//-1 for no throttling
trafficSimulator.randomDelayBetweenRequests('0.5-1.1');
trafficSimulator.setFunc('request', requestFunc);
trafficSimulator.start();
trafficSimulator.events.on('end', function (stats) {
//This function will run on exit/stop, when worker has received a message to offload his stats to his master
//Get from stats object all exposed metrics
console.log('Traffic Simulator Results');
console.log('-------------------------');
var cArr = Object.keys(stats.counters);
for (var i = 0; i < cArr.length; i++) {
var key = cArr[i];
console.log('counter %s: %s ', key, stats.counters[key]);
}
console.log("Exiting..");
process.exit();
})
//stop test after specific period or condition\
setInterval(() => {
if (range_start_from > total_content_length) {
trafficSimulator.stop();
}
}, 1100);
}
To implement thread pool for the incoming requests and throw an error if the pool is empty
To do:
[ ] Finalize issue #50
[ ] Prepare documentation and release notes
[ ] Set final version to 1.0.0
[ ] Publish basic lib to npm
When using this package for post request it blocks the req.write()
method which is used to write anything in the request body
Because of req.end()
in line 422 of lib/main.js
To reproduce this bug replace the requestFunc with below code
var requestFunc = function () {
//GENERATE REQUEST FUNCTION
const fileData = fs.readFileSync(__dirname + "/" + 'simple-request.js')
var headers = {
'Content-Type': 'application/json'
};
var options = {};
options['host'] = 'www.example.com';
options['port'] = '80';
options['path'] = '/';
options['method'] = 'POST';
if (headers) {
options['headers'] = headers;
}
//you can use the provided request function from HTS, in order 'catch'/count all response codes in a stats object
var req = trafficSimulator.request(options, function (response) {
console.log("Response: %s", response.statusCode);
response.setEncoding('utf8');
response.on('data', function (chunk) {
console.log(chunk.length)
});
});
req.write(JSON.stringify(fileData));
req.on('error', function (err) {
console.log('error:' + err.message);
});
}
Anonymize IN:
Anonymize OUT:
We could support 2 modes:
The anonymization feature can also be integrated in OpenAPI module (#72)
If needed we will split the work in smaller issues, keeping a reference (in comments) with this issue as a parent. For any split issue do not forget to add the labels:
Update where needed and provide more accurate details of usage, examples and HOW-TO
Improvements for the desktop-app using react and the electron framework.
Identify glitches and other issues related with UI or UX. Propose any changes that will make the app better, simpler and more intuitive for using it in making stress or load tests.
If needed we will split the work in smaller issues, keeping a reference (in comments) with this issue as a parent. For any split issue do not forget to add the labels:
Running two or more instances parallelly is not supported
To reproduce this issue:
Run simple-request.js parallelly using two different terminals.
When the number of clients is 1 and the number of workers is greater than or equal to 3, no request is sent to the requested server
To reproduce the bug:
Title:
UI Inconsistent Fix: The animation bar in the simulation connection appears too short
Description:
HTTPS Simulation connection animation bar looks slightly short, This issue affects the user experience by making the UI look inconsistent and unfinished.
Steps to reproduce the bug:
npm run dev
Open the simulation connection interface.
create project and run
Observe the connection bar between the monitor and server icons.
Expected behavior: The connection bar should be long enough to properly connect the monitor and server icons without appearing awkward or incomplete. but the actual behavior is the connection bar is too short, making the UI look odd and visually unbalanced.
image
Search the source code and any provided documentation, and rename any http-traffic-simulator occurrences to flexbench
The basic node js lib has been enhanced and additionally a desktop and server app have been implemented.
Before making the first major release we need to validate that the latest develop is in good shape, no regressions have been introduced, and the new apps are working as expected.
Under this issue we will address:
Clone develop branch from flexbench repo
Change directory to server-app
fellow README file and run npm install;
npm run dev
create project and run
I gone through the idealist page and have certain doubts regarding the GSOC goals for this project:
Please guide me through this so that I can start with the draft proposal
Implement a new module which will read OpenAPI (Swagger) documents and will create test scenarios for flexbench.
This module can be built in 2 phases:
Successfully implementing phase 1, means we can offer the module as a standalone script through npm for general usage, no depending on a flexbench app
If needed we will split the work in smaller issues, keeping a reference (in comments) with this issue as a parent. For any split issue do not forget to add the labels:
Facing this issue when running in development env
To remove the mongodb dependencies before releaseing server as a npm package
The body data is missing in the POST request or any request that contains body
To reproduce this try to add body in the POST , DELETE, PUT, PATCH request
Currently, the tool supports only http calls, even if the port is changed to 443. The config erroneously gives the user the impression that https urls could be used, but the core library does not support that, and it will fail.
Possible workaround:
When 443 port is used, the main lib should use the "https" module instead of "http".
Implement a simple desktop app, having just one button, when clicked running a simple flexbench scenario, showing the results to the user.
This poc will validate that the flexbench nodejs lib can be integrated in a desktop app, anyone could install at his PC
Review all the pages and make sure the provided info there:
Fix typos
Focus on restructuring the pages to help someone understand the build process for all the 3 apps:
Provide clear example of usage for all the 3 apps
Provide a GSoC > 2024 page to keep a track of work during the 2024 Google Summer of Code (do not delete the previous page for GSoC2024)
If needed we will split the work in smaller issues, keeping a reference (in comments) with this issue as a parent. For any split issue do not forget to add the labels:
Try to build and run the 3 different deliverables of flexbench: desktop, cli and server (all from "develop" branch)
Make sure the documentation is up to date and ready to use.
Please file bugs when you find something that's not working as expected.
Locate the file fileupload.js and implement a scenario to simulate fileuploads, using flexbench
When trying the basic example from README, with node 16 or 17, you will get this error:
giannis@Gianniss-MacBook-Pro testflexbench % node test.js
Response: 200
1256
/Users/giannis/gitRepos/testflexbench/node_modules/keep-alive-agent/index.js:26
var name = host + ':' + port;
^
TypeError: Cannot convert object to primitive value
at buildNameKey (/Users/giannis/gitRepos/testflexbench/node_modules/keep-alive-agent/index.js:26:18)
at KeepAliveAgent.freeHandler (/Users/giannis/gitRepos/testflexbench/node_modules/keep-alive-agent/index.js:35:13)
at KeepAliveAgent.emit (node:events:526:28)
at Socket.onFree (node:_http_agent:376:11)
at Socket.emit (node:events:526:28)
at emitFreeNT (node:_http_client:713:16)
at processTicksAndRejections (node:internal/process/task_queues:82:21)
Clone develop branch from flexbench repo
Change directory to server-app
fellow README file and run npm install; create .env file and modify it; run npm run dev
Errors would be generating in console
Refactor the library to use typescript
Locate the file manipulate_stream.js and implement a stream manipulation scenario (eg. simulate the scenario of watching a youtube video) using flexbench
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.