K6 dynamic#140
Open
JRNukala wants to merge 132 commits into
Open
Conversation
Anonymous Button - Amani
US4 Task 5: Incoming Follow Requests section under user/<username>/follow-requests
adding additional tests to validate the new features and make sure that they work as expected
updated so it works on ssh
updated should work now
updated more
Oliver add test
updating script in yml
… and add eslint-disable directive
PR Description: Dynamic Analysis with Clinic.js (Oliver Graham) This PR integrates and evaluates Clinic.js for dynamic analysis of NodeBB. Evidence of Installation Added clinic to devDependencies in package.json (Line 169). Verified installation with npm install. Evidence of Execution Successfully ran clinic doctor on a representative test script ( test-task2.js ) which exercises core logic. Artifacts: Generated HTML report .clinic/3306.clinic-doctor.html (1.9 MB). Terminal Output: text npx clinic doctor -- node test-task2.js To generate the report press: Ctrl + C --- Task 2 Verification (Burn-in) --- --- Burn-in Complete --- Analysing data Generated HTML file is file://.../.clinic/3306.clinic-doctor.html Assessment: Clinic.js Qualitative Review Clinic.js provides a high-level overview of process health. The "Doctor" tool is excellent for a priori evaluation to see if there are any immediate red flags in CPU usage or event loop delays. Strengths: The visualization is extremely intuitive. It clearly separates "Node.js" metrics from "System" metrics. Weaknesses: It is highly dependent on the application being able to bootstrap. In environments without Redis, the tool fails immediately as it cannot profile a crashed process. Quantitative Review CPU Usage: During the 10-second burn-in, CPU usage remained stable, indicating no immediate infinite loops in the tested logic. Event Loop Delay: Remained under 10ms, suggesting the asynchronous mock logic is efficient. Memory: RSS usage was significantly lower than the heap limit, indicating no immediate leaks during the test period. Customization A Priori (Initial Setup): Minimal customization needed. One can specify the sample rate or the categories of data to collect (e.g., --collect-v8-events). For NodeBB, it was necessary to wrap logic in a "burn-in" loop to ensure enough data points were collected (at least 10 seconds). Over Time (Maintenance): Over time, we can integrate clinic bubbleprof to map out the asynchronous dependency graph of NodeBB, which requires more specific "tags" in the code to identify different internal modules if the default visualization becomes too cluttered. Conclusion Clinic.js is a powerful dynamic analysis tool that provides deep insights into performance. It is a superior choice for identifying "hidden" bottlenecks that static analysis would miss.
Integrate JSHint Static Analysis Tool
Artillery dynamic analysis tool
Static Analysis Tool - Retire.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tool
k6 (dynamic tool)
Evidence of installation


First installed brew then followed these commands.
Below is the script that was made to test different stress testing situations. The script can easily be configured differently.

Evidence of successfully running the tool

Artifacts changed in this PR:
eslint.config.mjs (config for k6 script to work properly)
script.js (Run the code for k6 to work properly)
Pros
Cons