Socket
Socket
Sign inDemoInstall

github.com/gbbr/memstats

Package Overview
Dependencies
0
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    github.com/gbbr/memstats

Package memstats helps you monitor a running server's memory usage, visualize Garbage Collector information, run stack traces and memory profiles. To run the server, place this command at the top of your application: The next time you run your application, profiling is available via websockets on port 6061, and once a client is connected it will send updates every 2 seconds. Defaults can be changed by passing one or more of the APIs options as params to Serve. See the examples for each option. To use the provided webserver, run the command "memstat" once your applications starts and has profiling enabled. To change HTTP port or connected to other sockets than default, see:


Version published

Readme

Source

Installation

go get github.com/gbbr/memstats/...
go install github.com/gbbr/memstats/...

Basic usage

To monitor your application:

  • Import the package and add the line go memstats.Serve() into your code.
  • Run your application. Profiling information should now be available via websockets.
  • In the terminal or command line, run the memstats command to get a visual on http://localhost:8080

For more configuration options and API, see the documentation.

--

Dummy program

Write this program, and save it as main.go:

// filename: main.go
package main

import "github.com/gbbr/memstats"

func main() {
	memstats.Serve()
}

Run go run main.go to start the program.
Run memstats to start the web viewer on http://localhost:8080.

FAQs

Last updated on 17 Nov 2014

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc