Golang Time Series Data Generator
Full go doc style documentation for the project can be viewed online without
installing this package by using the excellent GoDoc site here:
http://godoc.org/github.com/intercloud/gotsgen
You can also view the documentation locally once the package is installed with
the godoc tool by running godoc -http=":6060" and pointing your browser to
http://localhost:6060/pkg/github.com/intercloud/gotsgen
$ go get -u github.com/intercloud/gotsgenAdd this import line to the file you're working in:
import "github.com/intercloud/gotsgen"To generate a tim series, you can use one of the 3 available generators:
- rand: values are random generated, see
math/randpackage (Float64()) - norm: values are generated from a normal distribution, see
math/randpackage (NormFloat64()) - deriv: values are generated from the dicrete derivative of a continuously and randomly increasing counter.
You have to instantiate the package first (let's say you want a one day time series of 200 measurements):
duration, _ := time.ParseDuration("24h")
end := time.Now()
start := end.Add(-duration)
gts := gotsgen.Query(start, end, 200, "rand")If you want to test an example program, simply run
cd example
go get -v
go run main.goThen open http://localhost:8080 in your browser.
Gotsgen is licensed under the Mozilla Public License 2.0.
Don't know which licence is the best for you ? visit https://choosealicense.com/
