
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
github.com/evangwt/statsview
Advanced tools
Statsview is a real-time Golang runtime stats visualization profiler. It is built top on another open-source project, go-echarts, which helps statsview to show its graphs on the browser.
$ go get -u github.com/go-echarts/statsview/...
Statsview is quite simple to use. All static assets have been packaged into the project thus it can be ran offline. It's worth pointing out that statsview has integrated the default profiler hence you don't need to import _ net/http/pprof separately.
import (
"time"
"github.com/go-echarts/statsview"
)
func main() {
go func() {
mgr := statsview.New()
// Start() runs a HTTP server at `localhost:18066` by default.
mgr.Start()
// Stop() will shutdown the http server gracefully
// mgr.Stop()
}()
// busy working....
time.Sleep(time.Minute)
}
// Visit your browser at http://localhost:18066/debug/statsview
// Or debug as always via http://localhost:18066/debug/pprof, http://localhost:18066/debug/pprof/heap, ...
Statsview gets a variety of configurations for the users. Everyone could customize their favorite charts style.
// WithInterval sets the interval(in millisecond) of collecting and pulling metrics
// default -> 1500
WithInterval(interval int)
// WithMaxPoints sets the maximum points of each chart series
// default -> 40
WithMaxPoints(n int)
// WithTemplate sets the rendered template which fetching stats from the server and
// handling the metrics data
WithTemplate(t string)
// WithAddr sets the listen address
// default -> "localhost:18066"
WithAddr(addr string)
// WithTimeFormat sets the time format for the line-chart Y-axis label
// default -> "15:04:05"
WithTimeFormat(s string)
// WithTheme sets the theme of the charts
// default -> Macarons
//
// Optional:
// * ThemeWesteros
// * ThemeMacarons
WithTheme(theme Theme)
import (
"github.com/go-echarts/statsview/viewer"
)
// set configurations before calling the `Start()` method
viewer.SetConfiguration(viewer.WithTheme(viewer.ThemeWalden), view.WithAddr("localhost:8087"))
Viewer is the abstraction of a Graph which in charge of collecting metrics from somewhere. Statsview provides some default viewers as below.
GCCPUFractionViewerGCNumViewerGCSizeViewerGoroutinesViewerHeapViewerStackViewerViewer wraps a go-echarts Line instance that means you can use all options/features on it. To be honest, I think that is the most charming thing about this project.


MIT ©chenjiandongx
FAQs
Unknown package
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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.