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

manus-performance-monitor

v1.0.1

Published

Monitor and analyze application performance metrics - Track execution time, memory usage, CPU, and generate reports

Readme

Manus Performance Monitor

Monitor and analyze application performance metrics. Track execution time, memory usage, CPU, and generate detailed performance reports.

Features

  • Execution timing - Measure function execution time
  • Memory monitoring - Track heap, RSS, and external memory
  • CPU profiling - Monitor CPU usage
  • Statistics - Min, max, average, median, p95, p99
  • Async support - Measure async functions
  • Reports - Generate and export performance reports
  • Global instance - Easy access from anywhere
  • Zero dependencies - Lightweight and fast

Installation

npm install manus-performance-monitor

Quick Start

const { start, end, measure, report } = require('manus-performance-monitor');

// Manual timing
start('myFunction');
// ... do something ...
const duration = end('myFunction');

// Automatic timing
measure('myFunction', () => {
  // ... do something ...
});

// Get report
const perf = report();
console.log(perf);

Advanced Usage

const { PerformanceMonitor } = require('manus-performance-monitor');

const monitor = new PerformanceMonitor();

// Measure function
const result = monitor.measure('calculation', () => {
  return 1 + 1;
});

// Measure async function
const data = await monitor.measureAsync('apiCall', async () => {
  return fetch('/api/data').then(r => r.json());
});

// Get statistics
const stats = monitor.getStats('apiCall');
console.log(stats);

// Get memory usage
const memory = monitor.getMemoryUsage();
console.log(memory);

// Print formatted report
monitor.printReport();

// Export as JSON
const json = monitor.export();

API Reference

PerformanceMonitor Class

start(label)

Start measuring time for a label.

end(label)

End measuring and record metric.

recordMetric(label, value)

Record a metric value.

getStats(label)

Get statistics for a metric (min, max, avg, median, p95, p99).

getAllStats()

Get statistics for all metrics.

measure(label, fn)

Measure synchronous function execution.

measureAsync(label, fn)

Measure asynchronous function execution.

getMemoryUsage()

Get current memory usage in MB.

getCPUUsage()

Get current CPU usage.

report()

Generate performance report.

printReport()

Print formatted performance report.

reset()

Reset all metrics.

resetMetric(label)

Reset specific metric.

export()

Export metrics as JSON.

Convenience Functions

  • start(label) - Start timer
  • end(label) - End timer
  • measure(label, fn) - Measure function
  • measureAsync(label, fn) - Measure async function
  • report() - Get report

Examples

API Performance Monitoring

const { measure, getStats } = require('manus-performance-monitor').getMonitor();

async function fetchUsers() {
  return measure('fetchUsers', async () => {
    return fetch('/api/users').then(r => r.json());
  });
}

// After multiple calls
const stats = getStats('fetchUsers');
console.log(`Average response time: ${stats.avg.toFixed(2)}ms`);

Database Query Profiling

const { measure, printReport } = require('manus-performance-monitor').getMonitor();

function queryDatabase(sql) {
  return measure('dbQuery', () => {
    // Execute query
  });
}

// Later
printReport();

Memory Leak Detection

const { getMemoryUsage } = require('manus-performance-monitor').getMonitor();

setInterval(() => {
  const memory = getMemoryUsage();
  if (memory.heapUsed > 500) {
    console.warn('High memory usage:', memory);
  }
}, 5000);

Statistics Explained

  • count - Number of measurements
  • min - Minimum value (ms)
  • max - Maximum value (ms)
  • avg - Average value (ms)
  • median - Middle value (ms)
  • p95 - 95th percentile (ms)
  • p99 - 99th percentile (ms)
  • total - Sum of all values (ms)

Memory Usage Fields

  • rss - Resident Set Size (MB)
  • heapTotal - Total heap allocated (MB)
  • heapUsed - Heap currently in use (MB)
  • external - External memory (MB)
  • arrayBuffers - Array buffers memory (MB)

Performance Tips

  • Use measure() for short operations
  • Use measureAsync() for I/O operations
  • Call printReport() periodically to check metrics
  • Reset metrics when starting new test phase
  • Monitor p95/p99 for performance issues

License

MIT License

Support

For issues and questions: https://github.com/kokashinobi/manus-ai-tools/issues


Made with ❤️ by Manus AI