Skip to content

Repository files navigation

NxMark

Browser GPU/CPU Monitoring & Benchmarking Tool for Linux

A comprehensive monitoring solution for benchmarking browser performance on Linux systems, capturing detailed GPU and CPU metrics with automated stress testing.

License: MIT

Overview

Brownyx is a professional-grade monitoring tool designed to benchmark browser performance under various stress levels. It automatically tests browsers (Chrome, Firefox, Safari/WebKit) until they crash, collecting detailed metrics on CPU, GPU, memory usage, and temperatures throughout the process.

Key Features

  • Multi-Browser Support: Test Chromium, Firefox, and WebKit
  • Progressive Stress Testing: Automatically escalate from low to extreme stress levels
  • Real-Time Monitoring: WebSocket-based live metrics streaming
  • GPU Metrics: Support for NVIDIA, AMD, and Intel GPUs
  • Beautiful Dashboards: Pre-configured Grafana dashboards
  • Automated Pipeline: Run tests until browser crash with detailed reporting
  • Time-Series Storage: All metrics stored in InfluxDB for historical analysis
  • Docker Ready: Complete Docker Compose setup for easy deployment

Architecture

┌─────────────────┐
│  React Frontend │ (Port 3003)
│   Control Panel │
└────────┬────────┘
         │
    ┌────┴─────────────────────────┐
    │                              │
┌───▼────────┐            ┌────────▼────────┐
│ API Server │            │  WebSocket      │
│ (Port 3000)│            │  (Port 3001)    │
└───┬────────┘            └────────┬────────┘
    │                              │
┌───▼──────────────────────────────▼────┐
│   Browser Controller (Playwright)      │
│   ┌──────────┐  ┌──────────┐          │
│   │ Chromium │  │ Firefox  │  etc...  │
│   └──────────┘  └──────────┘          │
└───┬────────────────────────────────────┘
    │
┌───▼──────────────────┐
│ Metrics Collector    │
│ (Python Script)      │
│ - CPU Usage          │
│ - GPU Usage          │
│ - Memory             │
│ - Temperature        │
└───┬──────────────────┘
    │
┌───▼──────────┐      ┌──────────────┐
│  InfluxDB    │◄─────┤   Grafana    │
│ (Port 8086)  │      │ (Port 3002)  │
└──────────────┘      └──────────────┘

Tech Stack

  • Backend: Node.js/TypeScript, Express.js
  • Frontend: React, TypeScript, Vite
  • Browser Automation: Playwright
  • Metrics Collection: Python (psutil, gpustat)
  • Time-Series DB: InfluxDB 2.7
  • Visualization: Grafana, Recharts
  • Containerization: Docker, Docker Compose

Prerequisites

For Docker Deployment (Recommended)

  • Docker Engine 20.10+
  • Docker Compose 2.0+
  • GPU drivers installed (NVIDIA/AMD/Intel)

For Local Development

  • Node.js 20+
  • Python 3.8+
  • GPU monitoring tools:
    • NVIDIA: nvidia-smi
    • AMD: radeontop
    • Intel: intel_gpu_top

Quick Start

Using Docker (Recommended)

  1. Clone the repository

    git clone https://github.com/VoidNxSEC/brownyx.git
    cd brownyx
  2. Set up environment variables

    cp .env.example .env
    # Edit .env if needed
  3. Start the services

    docker-compose up -d
  4. Access the applications

Local Development

  1. Install backend dependencies

    npm install
  2. Install Python dependencies

    pip install -r collector/requirements.txt
  3. Install Playwright browsers

    npx playwright install --with-deps chromium firefox webkit
  4. Install frontend dependencies

    cd frontend
    npm install
    cd ..
  5. Start InfluxDB and Grafana (Docker)

    docker-compose up -d influxdb grafana
  6. Start the backend

    npm run dev
  7. Start the frontend

    cd frontend
    npm run dev

Usage

Web Interface

The easiest way to run tests is through the web interface at http://localhost:3003

  1. Select browsers to test
  2. Choose headless mode (optional)
  3. Click "Start Progressive Stress Test" to test all selected browsers
  4. Or click individual browser buttons under "Run Until Crash"

API Endpoints

Start Progressive Stress Test

curl -X POST http://localhost:3000/api/test/progressive \
  -H "Content-Type: application/json" \
  -d '{
    "browsers": ["chromium", "firefox", "webkit"],
    "headless": false
  }'

Start Custom Test

curl -X POST http://localhost:3000/api/test/custom \
  -H "Content-Type: application/json" \
  -d '{
    "browser": "chromium",
    "testUrl": "https://example.com",
    "durationSeconds": 300,
    "headless": false
  }'

Run Until Crash

curl -X POST http://localhost:3000/api/test/until-crash \
  -H "Content-Type: application/json" \
  -d '{
    "browser": "chromium",
    "headless": false
  }'

Programmatic Usage

import { TestPipelineRunner } from './src/browser/pipeline';
import { InfluxDBClient } from './src/utils/influxdb';
import { Logger } from './src/utils/logger';

const logger = new Logger();
const influxClient = new InfluxDBClient(
  'http://localhost:8086',
  'your-token',
  'brownyx',
  'browser-metrics'
);

const pipeline = new TestPipelineRunner(influxClient, logger);

// Run progressive stress test
const result = await pipeline.runProgressiveStressTest(
  ['chromium', 'firefox'],
  false // headless
);

// Generate report
const report = pipeline.generateReport(result);
console.log(report);

Stress Test Levels

Brownyx includes 4 progressive stress levels:

Level Particles Canvas Size FPS Target Features
Low 100 800x800 30 Basic animation
Medium 1,000 1200x1200 60 Standard stress
High 5,000 1920x1920 60 Heavy computation + GPU effects
Extreme 20,000 3840x3840 120 Maximum stress + memory leak simulation

Metrics Collected

CPU Metrics

  • Overall usage percentage
  • Per-core usage
  • Frequency (MHz)
  • Temperature (if available)

GPU Metrics

  • GPU usage percentage
  • VRAM usage (MB and %)
  • Temperature
  • Power draw (NVIDIA)
  • Fan speed (NVIDIA)

Memory Metrics

  • Total/Used/Available RAM
  • Memory percentage
  • Swap usage

Process Metrics

  • Browser process CPU usage
  • Browser memory usage
  • Thread count

Grafana Dashboards

Pre-configured dashboards are automatically provisioned:

  1. Browser Performance Monitoring
    • CPU usage by browser
    • GPU usage by browser
    • Memory consumption
    • GPU temperature

Access at: http://localhost:3002 (admin/admin)

Configuration

Environment Variables

Create a .env file based on .env.example:

# InfluxDB Configuration
INFLUXDB_URL=http://localhost:8086
INFLUXDB_TOKEN=your-super-secret-auth-token
INFLUXDB_ORG=brownyx
INFLUXDB_BUCKET=browser-metrics

# API Server
API_PORT=3000
WS_PORT=3001

# Grafana
GRAFANA_PORT=3002

# Test Configuration
TEST_BROWSERS=chromium,firefox,webkit
TEST_DURATION_MINUTES=60
STRESS_TEST_INCREMENTAL=true

Project Structure

brownyx/
├── collector/              # Python metrics collector
│   ├── metrics_collector.py
│   └── requirements.txt
├── frontend/               # React frontend
│   ├── src/
│   │   ├── App.tsx
│   │   └── main.tsx
│   ├── package.json
│   └── vite.config.ts
├── grafana/                # Grafana configuration
│   ├── dashboards/
│   └── provisioning/
├── logs/                   # Application logs
├── src/                    # Backend TypeScript
│   ├── api/                # API server
│   ├── browser/            # Browser controller & pipeline
│   ├── types/              # TypeScript types
│   ├── utils/              # Utilities (InfluxDB, Logger)
│   └── index.ts            # Main entry point
├── docker-compose.yml      # Docker services
├── Dockerfile              # Application container
├── package.json            # Node.js dependencies
└── tsconfig.json           # TypeScript config

GPU Support

NVIDIA GPUs

Brownyx automatically detects NVIDIA GPUs using nvidia-smi. Ensure you have:

  • NVIDIA drivers installed
  • nvidia-smi available in PATH

AMD GPUs

For AMD GPUs, install radeontop:

# Ubuntu/Debian
sudo apt install radeontop

# Arch Linux
sudo pacman -S radeontop

Intel GPUs

For Intel integrated graphics:

# Ubuntu/Debian
sudo apt install intel-gpu-tools

# Arch Linux
sudo pacman -S intel-gpu-tools

Troubleshooting

Browser won't launch

  • Ensure Playwright browsers are installed: npx playwright install --with-deps
  • Check system dependencies for your distribution

GPU metrics not showing

  • Verify GPU drivers are installed
  • Check that monitoring tools are available
  • Run python3 collector/metrics_collector.py to test

InfluxDB connection errors

  • Verify InfluxDB is running: docker ps | grep influxdb
  • Check token and credentials in .env
  • Ensure bucket exists in InfluxDB

Permission denied on GPU access

# Add user to video group
sudo usermod -a -G video $USER
# Re-login for changes to take effect

Development

Running Tests

npm test

Building

# Backend
npm run build

# Frontend
cd frontend && npm run build

Linting

npm run lint

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Roadmap

  • Support for macOS and Windows
  • Custom stress test scenarios
  • Network performance metrics
  • Video playback benchmarks
  • WebGL/WebGPU specific tests
  • Comparison reports export (PDF/CSV)
  • Historical trend analysis
  • Performance regression detection
  • Slack/Discord notifications

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Support


Made with ❤️ for the browser benchmarking community

About

This is a modest monitoring tool for benchmark browser's use on linux (other's so's soon), for catch all relevant paramethers and metrics, reporting a final assessment which indicate how good your browser are running in low, medium and intensive resource usage, for both CPU's and GPU's consume.

Resources

Contributing

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages