NPM Packages

Comprehensive performance monitoring agents for every stack

Categories

Core Package

@stacksleuth/core

npm version downloads

The foundation of StackSleuth - provides core profiling capabilities, metric collection, and integration APIs for all agents.

Installation

npm install @stacksleuth/core

Basic Usage

import { ProfilerCore } from '@stacksleuth/core';

const profiler = new ProfilerCore({
  apiKey: 'your-api-key',
  environment: 'production'
});

// Start profiling
profiler.startProfiling();

// Capture custom metrics
profiler.captureMetric('custom.metric', 123);

// Stop profiling
const report = await profiler.stopProfiling();

Key Features

  • Unified profiling interface
  • Real-time metric collection
  • Low overhead design
  • TypeScript support
  • Extensible plugin system

Frontend Framework Agents

@stacksleuth/react-agent

npm version React

Advanced React performance monitoring with component lifecycle tracking, render optimization insights, and hooks profiling.

Installation

npm install @stacksleuth/react-agent

Setup

import { ReactAgent } from '@stacksleuth/react-agent';

// Initialize in your app entry point
ReactAgent.init({
  apiKey: 'your-api-key',
  trackRenders: true,
  trackStateChanges: true,
  trackEffects: true
});

// Wrap your app
function App() {
  return (
    <ReactAgent.Provider>
      {/* Your app components */}
    </ReactAgent.Provider>
  );
}

@stacksleuth/vue-agent

npm version Vue

Vue.js performance monitoring with component tracking, reactive system profiling, and Vuex state management insights.

Installation

npm install @stacksleuth/vue-agent

@stacksleuth/svelte-agent

npm version Svelte

Svelte performance monitoring with component lifecycle tracking, store monitoring, and compilation insights.

Usage

import { SvelteAgent } from '@stacksleuth/svelte-agent';

// Initialize in your app
SvelteAgent.init({
  apiKey: 'your-api-key',
  trackStores: true,
  trackComponents: true
});

// Use in components
<script>
  import { onMount } from 'svelte';
  import { trackComponent } from '@stacksleuth/svelte-agent';
  
  trackComponent('MyComponent');
</script>

Backend Framework Agents

@stacksleuth/fastapi-agent

npm version Python

FastAPI performance monitoring with route tracking, async operation profiling, and WebSocket monitoring.

Installation

pip install stacksleuth-fastapi

Python Setup

from fastapi import FastAPI
from stacksleuth_fastapi import FastAPIAgent

app = FastAPI()
agent = FastAPIAgent(api_key="your-api-key")

# Apply middleware
agent.instrument_app(app)

@app.get("/")
async def root():
    return {"message": "Hello World"}

@stacksleuth/backend-agent

npm version Node.js

Universal Node.js backend monitoring supporting Express, Koa, Hapi, and more.

Database Agents

@stacksleuth/redis-agent

npm version Redis

Redis performance monitoring with command-level tracking, memory analysis, and slow query detection.

Usage with redis

import { RedisAgent } from '@stacksleuth/redis-agent';
import { createClient } from 'redis';

const agent = new RedisAgent({ apiKey: 'your-api-key' });
const client = createClient();

// Instrument the client
agent.instrument(client);

// Use Redis normally
await client.set('key', 'value');
const value = await client.get('key');

@stacksleuth/mysql-agent

npm version MySQL

MySQL query performance monitoring with execution plan analysis and connection pool tracking.

@stacksleuth/mongodb-agent

npm version MongoDB

MongoDB performance monitoring with query profiling, index usage analysis, and aggregation pipeline tracking.

Browser Automation Agent

@stacksleuth/browser-agent

npm version Browser

Advanced browser automation with Playwright/Puppeteer integration for debugging, crawling, and user simulation.

Key Features

  • Automated browser testing
  • Session recording & replay
  • Intelligent web crawling
  • User behavior simulation
  • Performance metrics collection

Example: Automated Testing

import { BrowserAgent } from '@stacksleuth/browser-agent';

const agent = new BrowserAgent({
  apiKey: 'your-api-key',
  headless: true
});

// Run automated tests
const results = await agent.runTests({
  url: 'https://example.com',
  tests: [
    { action: 'click', selector: 'button.submit' },
    { action: 'waitFor', selector: '.results' },
    { action: 'screenshot', name: 'results-page' }
  ]
});

Tools & CLI

@stacksleuth/cli

npm version CLI

Command-line interface for StackSleuth configuration, monitoring, and analysis.

Global Installation

npm install -g @stacksleuth/cli

Common Commands

# Initialize StackSleuth in your project
stacksleuth init

# Start monitoring
stacksleuth monitor start

# View real-time metrics
stacksleuth metrics --watch

# Generate performance report
stacksleuth report generate --format=html

# Analyze specific time range
stacksleuth analyze --from="2024-01-01" --to="2024-01-31"