Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
arl committed Sep 23, 2023
1 parent 57024f8 commit 86e74b4
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
[![Test Actions Status](https://github.com/arl/statsviz/workflows/Tests-linux/badge.svg)](https://github.com/arl/statsviz/actions)
[![Test Actions Status](https://github.com/arl/statsviz/workflows/Tests-others/badge.svg)](https://github.com/arl/statsviz/actions)


# Statsviz

<p align="center">
Expand All @@ -33,6 +34,7 @@ Visualize real time plots of your Go program runtime metrics, including heap, ob
- [Changelog](#changelog)
- [License](#license)


## Install

Download the latest version:
Expand All @@ -41,6 +43,7 @@ Download the latest version:
go get github.com/arl/statsviz@latest
```


## Usage

Register `Statsviz` HTTP handlers with your application `http.ServeMux`.
Expand All @@ -50,15 +53,16 @@ mux := http.NewServeMux()
statsviz.Register(mux)

go func() {
log.Println(http.ListenAndServe("localhost:6060", mux))
log.Println(http.ListenAndServe("localhost:8080", mux))
}()
```

Open your browser at http://address:port/debug/statsviz
Open your browser at http://localhost:8080/debug/statsviz


## Advanced Usage

For more control over to serve Statsviz UI from your program, you can call `statsviz.NewServer`.
For more control over how to serve Statsviz UI from your program, you can call `statsviz.NewServer`.

```go
srv := statsviz.NewServer()
Expand All @@ -72,6 +76,7 @@ srv.Ws()

Checkout the [Examples](_example) directory.


## How does that work?

The call to `statsviz.Register` registers 2 HTTP handlers within the given `http.ServeMux`:
Expand All @@ -82,6 +87,7 @@ The call to `statsviz.Register` registers 2 HTTP handlers within the given `http

Data points are in a browser-side circular-buffer.


## Documentation

### Go API
Expand Down

0 comments on commit 86e74b4

Please sign in to comment.