npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

performancenilgiri

v0.0.10

Published

AI Powered performance tool for performance testing

Readme

nilgiri-performance : A Core Component of the Nilgiri Framework

This nilgiri-performance module integrates the power of the K6 performance testing framework with AI-driven insights to simplify and enhance performance testing. It provides an intuitive interface to configure key test parameters, such as the URL, virtual users (VUs), and test duration. Once the tests are executed, AI analyzes the results to generate comprehensive performance reports, enabling a deeper understanding of product efficiency and scalability. Perfect for teams aiming to automate and elevate their performance testing workflows.

Before we go to Setup Lets See what are the prerequisites

Prerequisites

  1. Ensure you have Node.js and TypeScript installed on your machine.

    • You can download Node.js from here.
    • To install TypeScript globally, run the following command:
      npm install -g typescript
  2. K6: Make sure K6 is installed on your system.

  3. IDE: This project is written in TypeScript, so you'll need to IDE Which Supports NodeJs, For Example : VScode , Intelli ,Etc.

  4. AI API Key and EndPoint: This Project is AI-driven,Hence User are requested to get ready with AI API Auth Key and End Point .


Setup: Install and Run

Note : Below two steps is for Creating new Project , if you alreday project then please ignore the below two steps

Create a New Node.js Project (If Needed)

If you don’t have a Node.js project yet, follow these steps:

Create a new project folder:

 mkdir my-performance-project && cd my-performance-project

Initialize a new Node.js project:

 npm init -y
  1. Install the Dependency:
    npm install performancenilgiri --save -d

Running the Application

To run the runK6Test method, import and call it in your script:

Example: Create new testFile.tsfile and copy paste the below example code ,

replace your reportPath, AiUrl and apikey with correct values .

const { runPerformanceTest } = require('performancenilgiri');

runPerformanceTest({
    request: {
        method: 'POST',
        url: 'https://jsonplaceholder.typicode.com/posts',
        body: {
          title: 'foo',
          body: 'bar',
          userId: 1
        },
        headers: {
          'Content-Type': 'application/json'
        }
      },
    options: { vus: 10, duration: '5s' },
    aireport: {
        reportPath: "./performance_report.html",
       AiUrl: "https://ai-analysis-api.com",
       apikey: "your-api-key"
      },
      detailedReportjson: "./performance_metrics.json"
    
  });


Parameters

| Parameter | Type | Description | Example | |--------------------|--------|-------------------------------------------------------------------|----------------------------------------------| | url | string | The target URL for performance testing. | 'https://example.com' | | options | object | K6 test options (VU[virtual users] count, duration, etc.). | { vus: 10, duration: '30s' } | | aireport | object | AI report configuration. | { reportPath: './report.html', AiUrl: '...' } | | aireport.reportPath | string | Path to save the AI-generated performance report. | './ai_report.html' | | aireport.AiUrl | string | AI API endpoint for performance analysis. | 'https://ai-analysis-api.com' | | aireport.apikey | string | API key for AI service authentication. | 'your-api-key' | | detailedReportjson | string (optional) | Path to save a detailed JSON performance report. | './performance_metrics.json' |


If you are running your file in Type Script then follow this Step

Steps to Run

  1. Compile the TypeScript file: In your terminal, navigate to the project folder and run the following command to compile the TypeScript file:
    tsc testFile.ts
    node testFile.js

Report Preview

Performance Report


The K6 Performance Test Report provides a comprehensive analysis of your application's performance based on simulated user traffic. The report is designed to help developers, testers, and stakeholders understand key performance metrics in a visually intuitive format.

🟢 Summary Metrics

The report displays high-level performance indicators in colored tiles at the top, offering a quick glance at critical statistics:

| Metric | Description | |------------------|-------------| | Total Requests | Total number of HTTP requests executed during the test. | | Time Duration | The total execution time of the test. | | Virtual Users | Number of concurrent users simulated during the test. | | Throughput | The rate at which requests were processed per second. | | Pass Count | Number of successful requests (HTTP 200 status). | | Fail Count | Number of failed requests due to errors or timeouts. | | Iterations | Number of times the test script was executed. | | Error Rate | Percentage of failed requests compared to total requests. |

📈 Performance Graphs

Below the summary tiles, the report provides two visual representations of performance trends using bar and line charts.

1️⃣ HTTP Request Duration (Bar Chart)

This chart displays the distribution of HTTP response times across different statistical metrics:

  • Min, Median, Average – Represent baseline response times.
  • Max – The slowest request recorded during the test.
  • p90, p95 – The 90th and 95th percentile values, indicating the response time thresholds below which 90% or 95% of requests completed.

📌 Interpretation:

A high max response time or p95 value suggests potential performance bottlenecks. Optimizing server response times, caching strategies, or load balancing might be necessary.

2️⃣ Iteration Duration (Line Chart)

This chart represents the time taken for each test iteration over different statistical points:

  • Min, Median, Average – General test execution time trends.
  • Max, p90, p95 – Indicators of performance spikes.

📌 Interpretation:

A steadily increasing trend may indicate performance degradation over time, possibly due to memory leaks, inefficient resource management, or increasing server load.

📌 Additional Insights

🔹 Performance Metrics Dropdown
Expands to provide a more detailed breakdown of test execution times and resource utilization.

🔹 AI Analysis Dropdown
Since this report AI-powered analysis is enabled, this section offers automated insights and recommendations to optimize performance based on test results.

🛠️ How to Use This Report?

  • Identify potential bottlenecks by analyzing high response times and failure rates.
  • Compare p90/p95 percentiles against expected SLAs (Service Level Agreements).
  • Use AI-generated insights (if enabled) to apply recommended optimizations.
  • Adjust test configurations (e.g., increasing virtual users) to simulate real-world scenarios accurately.

Features

  • Interactive CLI to define K6 test parameters
  • Supports optional iterations, delays, and ramp-up stages
  • Runs the K6 test and exports the summary as detailedReport.json
  • Analyzes the K6 test summary and generates a report
  • Uses AI to analyze performance metrics and generate insights

Support

Thank you for choosing nilgiri-performance as part of the Nilgiri framework for your Node.js utility needs!