1
1
Fork
You've already forked anystream
0
JSON stream data generator
  • Go 99.7%
  • Dockerfile 0.3%
Find a file
2026年07月07日 21:07:10 +02:00
file file docs 2026年07月07日 21:07:10 +02:00
generator file testing 2026年07月06日 22:43:14 +02:00
parser file testing 2026年07月06日 22:43:14 +02:00
plots file docs 2026年07月07日 21:07:10 +02:00
sink improved event scheduling 2026年05月22日 15:25:37 +02:00
testing file testing 2026年07月06日 22:43:14 +02:00
.gitignore init parser 2025年06月19日 15:11:05 +02:00
docker-compose.yaml rocketmq init 2026年03月19日 16:07:02 +01:00
Dockerfile file docs 2026年07月07日 21:07:10 +02:00
go.mod init copula generation 2026年07月06日 20:55:20 +02:00
go.sum init copula generation 2026年07月06日 20:55:20 +02:00
LICENSE Initial commit 2024年03月22日 15:45:50 +01:00
main.go file testing 2026年07月06日 22:43:14 +02:00
README.md file docs 2026年07月07日 21:07:10 +02:00
tutorial.md file docs 2026年07月07日 21:07:10 +02:00

anystream

JSON stream data generator. Produces random data with user-defined types and sends it to:

  • stdout
  • unix socket
  • websocket
  • sse
  • amqp
  • kafka
  • nats
  • pulsar
  • mqtt
  • nsq
  • valkey streams
  • rocketmq
  • more

Installation

Options:

Usage

See tutorial for more examples.

Options

Example usage:

anystream \
 -f "ts timestamp ms" \
 -f "meta.age uniform 18 100" \
 -f "meta.height normal 170 10" \
 -f "meta.gender categorical male female unknown" \
 -f "results pareto[5] 100 3" \
 -e 5

For all options, see:

anystream -h

Field definition

data_type args example
bernoulli p is_customer bernoulli 0.8
categorical any number > 0 gender categorical male female unknown
normal mean, std height normal 170 10
pareto xm, alpha income pareto 1000 2
gamma alpha, beta waiting gamma 1 0.5
beta alpha, beta probability beta 0.5 0.5
poisson lambda visits poisson 5
poissonnhpp baseline, (period, center, std, amplitude) visits poissonnhpp 5 60 2 0.5 50
timeformatted format event_iso timeformatted %Y-%m-%dT%H:%M:%S%:z
timepart part* event_hour timepart hour
timestamp unit** event_ts timestamp ms
uniform min, max age uniform 0 100
uuid - event_id uuid
serial from serial_id serial 1
serialtimed from, unit** serial_id serial 1 s
null - extra null
file path, strategy*** file test_data.parquet sample

*part: [year, month, day, weekday, hour, minute, s, ms, micros, ns, ]

** unit: [s, ms, micros, ns, ]

*** strategy: [sample, copula, ]

All data types take optional [<n>] suffix for generating list of values. E.g. uuid produces single value, uuid[5] produces list of 5 values.

Fields can be nested using parent.child syntax in field name.

Testing

podman-compose up -d
go test -v ./...

Build

gox \
 -os="darwin linux" \
 -arch="amd64 arm64" \
 -output="anystream_v0.11_{{.OS}}_{{.Arch}}" \
 -ldflags="-s -w"
# docker
sudo podman build . -t codeberg.org/ppatrzyk/anystream:0.11