miller/scripts/make-data-stream
2021-12-21 23:15:14 -05:00

32 lines
747 B
Text
Executable file

stop=1000000000
profile=""
#stop=1000000
#profile="cpuprofile cpu.pprof"
mlr \
$profile \
--ocsv \
--igen --gen-stop $stop \
put '
begin {
@colors=["red","purple","yellow","green","blue","orange"];
@shapes=["triangle","square","circle","pentagon","hexagon"];
@index = 1;
}
$color = urandelement(@colors);
$shape = urandelement(@shapes);
$flag = (urand32() < 0.6) ? "true" : "false";
$index = @index;
$quantity=fmtnum(urandrange(50,100),"%.4f");
$rate=fmtnum(urandrange(1,10),"%.4f");
@index += urandint(2,10);
' \
then filter '$quantity > 60.0' \
then put '$y = $k + $index**2 + log10($rate/$quantity)' \
then rename i,k \
then cut -xf index \
then filter '$rate > 2'