Skip to content

N0llas/nodejs-metrics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node.js Metrics Dashboard & Tracker

This project consists of two main parts: a Dashboard and a Tracker.

  • Dashboard: A Next.js server that visualizes Node.js metrics.
  • Tracker: A reusable package that sends Node.js metrics to the Dashboard.

Dashboard Preview

Dashboard Preview

Dashboard Preview

Dashboard Preview

Dashboard

The dashboard is a Next.js server that runs on port 9090 and exposes APIs to collect metrics.

Setup

  1. Navigate to the dashboard folder:

    cd dashboard
  2. Install dependencies:

    npm install
  3. Start the development server:

    npm run dev
  4. The server will be accessible at: http://localhost:9090


Tracker

The tracker is a Node.js package that can be installed in any project to send metrics to the dashboard.

Setup

  1. Move the tracker package(tracker-1.0.0.tgz) to the root of the project you want to monitor. For example, if your project runs on localhost:3000:

  2. Install the package:

    npm install ./tracker-1.0.0.tgz
  3. Import and activate the tracker in your project. For example, in your Next.js layout.tsx:

    import { activateMetrics } from "tracker";
    
    activateMetrics();
  4. Once activated, metrics from this project will be sent to the dashboard for visualization:

    Important: Do not call activateMetrics in client-side code, as it only works in Node.js.


Note:
This is a test prototype. Currently, it uses setTimeout for sending metrics, but in the future it will be replaced with a proper socket server.
The dashboard uses Chart.js ("chart.js": "^4.5.1") — special thanks to this cool library!
This project is mainly for learning purposes.

About

A performance monitoring tool for Node.js applications.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published