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 🙏

© 2024 – Pkg Stats / Ryan Hefner

skyeye-agent

v1.0.3

Published

Process monitor for Node.js.

Downloads

13

Readme

Skyeye

Process monitor for Node.js.

Skyeye-cli

Install

npm install skyeye-cli -g

skyeye -h

#Usage: skyeye [options] [command]

#Options:
#
#  -V, --version     output the version number
#  -h, --help        output usage information
#
#Commands:
#
#  config [options]  Update skyeye configuration.
#  start [options]   Start skyeye monitor server and register server.
#  cmd [options]     Send command to monitor server.
#  add [options]     Create a secret token.
#  help [cmd]        display help for [cmd]

How to use

  1. Configure the central node server information
skyeye config

# prompt: host:  (0.0.0.0) 
# prompt: port:  (8080) // Register Server Port = 8081
# prompt: password:  (1q2w3e4r) 
# prompt: redis_host:  (127.0.0.1) 
# prompt: redis_port:  (6379) 
  1. Start the central node server

When you run this command, the WebSockt Server and Register Server are started

skyeye start

# Start WebSocket Server!PID:719
# Start Register Server!PID:720
  1. Get the Agent secret key
curl http://127.0.0.1:8081/127.0.0.1/1533038565835/19561612

# AgentIp = 127.0.0.1
# Timestamp = 1533038565835
# Token = md5(1q2w3e4r,127.0.0.1,1533038565835)
# http://127.0.0.1:8081/${AgentIp}/${Timestamp}/${Token}
# {"code":0,"token":"bd864703"}

or

skyeye add -a 127.0.0.1

#| -------------------- | ---------- 
#| AGENT_IP             | TOKEN        
#| -------------------- | ----------
#| 127.0.0.1_3701       | bd864703    
#| -------------------- | ----------

Skyeye-agent

Install

npm install skyeye-agent --save

Error reporting during installation like:g++: command not found ,please install gcc,gcc+,gcc-c++ first

How to use

let agent = require('skyeye-agent').default;
let skyeyeHost = '127.0.0.1';
let skyeyePort = 8080;
let agentSecret = 'bd864703';
let agentName = '3701'; // port,默认为 PID
let checkInterval = 10000; // 10000ms, check WebSocket heath interval
let withHeartbeat = false; // Report server status while performing health checks
agent.start(skyeyeHost, skyeyePort, agentSecret, agentName, checkInterval, withHeartbeat);

Display Agent State

skyeye cmd -h

#Usage: skyeye-cmd [options] [command]
#
#Options:
#
#  -V, --version       output the version number
#  -h, --help          output usage information
#
#Commands:
#
#  list [options]      Report all online agent.
#  stat [options]      Report target agent server stat.
#  profiler [options]  Report target agent server cpu profiler.
#  heap [options]      Report target agent heap snapshot.
#  help [cmd]          display help for [cmd]
  1. List all online agents
skyeye cmd list

#| -------------------- | ---------- 
#| AGENT_ID             | STATE     
#| -------------------- | ----------
#| 127.0.0.1_3701       | ONLINE     
#| -------------------- | ----------
  1. Report the status of the agent
skyeye cmd stat -a 127.0.0.1_3701

#Command send succeed, Please wait 5 second!

#| -------------------- | ---------- | ----------
#| AGENT_ID             | CPU        | CTIME     
#| -------------------- | ---------- | ----------
#| 127.0.0.1_3701       | 43.9       | 0:15.74   
#| -------------------- | ---------- | ----------
  1. Report the function execution time of the agent
skyeye cmd profiler -a 127.0.0.1_3701 -t 1000 // 执行时间在1000毫秒以上的方法才会显示,默认500

#Command send succeed, Please wait 5 second!

#| TOP EXECUTING FUNCTIONS
#| -------------------- | ---------- | ---------- | ------------------------------
#| funName              | execTime:  | percentage | url                           
#| -------------------- | ---------- | ---------- | ------------------------------
#| setInterval          | 1806.372   | 100.00     | (/skyeye/skyeye-agent/demo.js 24)
#| fabonacci            | 1806.372   | 100.00     | (/skyeye/skyeye-agent/demo.js 5)
#| consume              | 1806.372   | 100.00     | (/skyeye/skyeye-agent/demo.js 4)
#| setInterval          | 1757.954   | 100.00     | (/skyeye/skyeye-agent/demo.js 24)
#| -------------------- | ---------- | ---------- | ------------------------------
#| TIMEOUT FUNCTIONS, timeout(1000ms)
#| -------------------- | ---------- | ---------- | ------------------------------
#| funName              | execTime:  | percentage | url                           
#| -------------------- | ---------- | ---------- | ------------------------------
#| consume              | 1806.372   | 100.00     | (/skyeye/skyeye-agent/demo.js 4)
#| fabonacci            | 1806.372   | 100.00     | (/skyeye/skyeye-agent/demo.js 5)
#| setInterval          | 1806.372   | 100.00     | (/skyeye/skyeye-agent/demo.js 24)
#| setInterval          | 1757.954   | 100.00     | (/skyeye/skyeye-agent/demo.js 24)
#| consume              | 1757.954   | 100.00     | (/skyeye/skyeye-agent/demo.js 4)
#| -------------------- | ---------- | ---------- | ------------------------------
  1. Report the heap snapshot of the agent
skyeye cmd heap -a 127.0.0.1_3701

#The command was successfully sent. Please wait for 5 seconds
#HEAP Snapshot download succeed, path:/skyeye/skyeye/dump/127.0.0.1_5906.heapsnapshot