Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@hstech/memviz

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hstech/memviz

Tool for the visualization of the Node.js memory usage in runtime.

  • 1.6.1
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

@hstech/memviz

Tool for the visualization of the Node.js memory usage in an application.

NPM Version

memviz demo

Install

npm i -S @hstech/memviz

Usage

Just add this code to your index.js

const memViz = require("@hstech/memviz");

memViz({ port: 10101 });

Options

All options are optional

PS: for S3 snapshot upload please provide these environment variables

AWS_CREDENTIALS_ACCESSKEY_ID // AWS access key associated with an IAM user or role
AWS_CREDENTIALS_SECRET_ACCESS_KEY // The secret key associated with the access key
{
  port: 10100,  // Port (default)
  interval: 300, // Refresh interval of data in milliseconds (default)
  duration: 120000, // Duration of the chart in milliseconds, how much time of data it will show. (default)
  application: 'Application' // Application name (default)

  s3: { // If s3.bucket is null, the heapsnapshot will be written to disc
    bucket: 'YOUR_BUCKET_NAME', // default is null
    folder: '/sub-folder' // default is '/'
  }
}

Interaction

You can zoom in/out the chart using the mouse wheel or via a pinch gesture, you can also move the chart left or right.

MultiView

Visit any of your Visualizer host with the path /memviz/multiview example http://localhost:10100/memviz/multiview.

Let's say you want to display 3 charts on the same view, for these hosts

  • http://localhost:10100/memviz/
  • http://localhost:10101/memviz/
  • http://localhost:10102/memviz/

and you want to display 2 in each row, then your url should look like this:

http://localhost:10100/memviz/multiview?perRow=2&hosts=http://localhost:10100/,http://localhost:10101/,http://localhost:10102/

Integration

Koa

To integrate memviz into Koa, all you have to do is to pass the Instance and the port to memviz

// Koa instance is in app variable

memViz({
  koa: app, // Koa instance
  port: 3000, // Koa instance port
  interval: 300,
  duration: 120000,
  application: "Application 1",
});

Then visit this path /memviz/ you should see the memory graph

License

MIT

Keywords

FAQs

Package last updated on 21 Jun 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc