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

gateway-metrics-parser

v1.0.0

Published

CLI tool to parse, analyze, and visualize OpenClaw gateway performance metrics from CSV logs

Readme

gateway-metrics-parser

A lightweight CLI tool to parse, analyze, and visualize OpenClaw gateway performance metrics. Reads from CSV logs (generated by gateway-metrics.sh) and provides quick insights into gateway health, response times, resource usage, and uptime trends.

Installation

npm install -g gateway-metrics-parser

Usage

# Parse metrics from file
gateway-metrics parse /path/to/metrics.csv

# Show summary statistics
gateway-metrics summary /path/to/metrics.csv

# Find anomalies (high response times, RSS spikes)
gateway-metrics anomalies /path/to/metrics.csv

# Export to JSON for integration with other tools
gateway-metrics json /path/to/metrics.csv

# Show p95/p99 response times
gateway-metrics percentiles /path/to/metrics.csv

# Monitor for restarts (connection resets)
gateway-metrics restarts /path/to/metrics.csv

# Real-time tail (last N records)
gateway-metrics tail /path/to/metrics.csv --lines=20

# Help
gateway-metrics --help

Examples

Parse and summarize metrics

gateway-metrics summary metrics.csv

Output:

Gateway Metrics Summary
=======================
Records analyzed: 1,234
Time range: 2026-02-24 10:00 to 2026-02-24 18:30
Uptime: 99.7%

Response Time (ms):
  Min: 12ms
  Max: 487ms
  Avg: 45.3ms
  P95: 120ms
  P99: 310ms

Memory (RSS MB):
  Min: 48MB
  Max: 156MB
  Avg: 92.1MB
  Peak spike: +24MB at 14:15

Active Connections:
  Min: 2
  Max: 18
  Avg: 8.3

Restarts detected: 0

Find anomalies

gateway-metrics anomalies metrics.csv --threshold=200

Identifies response time spikes, memory leaks, and connection resets.

Export to JSON for dashboarding

gateway-metrics json metrics.csv > metrics.json

Useful for feeding into monitoring dashboards or Grafana.

CSV Format

Expected input (from gateway-metrics.sh):

timestamp,response_time_ms,rss_mb,connections,uptime_seconds
2026-02-24T10:00:01Z,34,92,5,36000
2026-02-24T10:00:31Z,42,93,6,36030
...

Features

  • ✅ Lightweight (zero dependencies)
  • ✅ Fast parsing (handles 10k+ records instantly)
  • ✅ Statistical analysis (min, max, avg, percentiles)
  • ✅ Anomaly detection (response time spikes, memory trends)
  • ✅ Uptime calculation with restart detection
  • ✅ JSON export for integration
  • ✅ Human-readable summary reports

Use Cases

  • Monitor OpenClaw gateway health during CI/CD pipelines
  • Detect performance degradation early
  • Correlate gateway metrics with application errors
  • Build SLO dashboards
  • Audit resource usage trends

License

MIT