https://github.com/akramarenkov/stat
Library that provides to collect and display the quantity of occurrences of values in given spans
https://github.com/akramarenkov/stat
go golang statistics
Last synced: about 1 year ago
JSON representation
Library that provides to collect and display the quantity of occurrences of values in given spans
- Host: GitHub
- URL: https://github.com/akramarenkov/stat
- Owner: akramarenkov
- License: mit
- Created: 2024-11-02T02:50:38.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-04-03T02:34:24.000Z (about 1 year ago)
- Last Synced: 2025-04-03T03:27:29.059Z (about 1 year ago)
- Topics: go, golang, statistics
- Language: Go
- Homepage:
- Size: 102 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
# Stat
[](https://pkg.go.dev/github.com/akramarenkov/stat)
[](https://goreportcard.com/report/github.com/akramarenkov/stat)
[](https://coveralls.io/github/akramarenkov/stat)
## Purpose
Library that provides to collect and display the quantity of occurrences of
values in given spans
## Usage
Example:
```go
package main
import (
"fmt"
"os"
"github.com/akramarenkov/stat"
)
func main() {
sts, err := stat.NewLinear(1, 100, 20)
if err != nil {
panic(err)
}
sts.Inc(0)
sts.Inc(1)
sts.Inc(20)
sts.Inc(21)
sts.Inc(22)
sts.Inc(40)
sts.Inc(41)
sts.Inc(42)
sts.Inc(59)
sts.Inc(60)
sts.Inc(61)
sts.Inc(62)
sts.Inc(80)
sts.Inc(81)
sts.Inc(100)
sts.Inc(101)
fmt.Println(sts.Graph(os.Stderr))
// Output:
//
}
```