mingrammer / flog

:tophat: A fake log generator for common log formats
MIT License
1.12k stars 135 forks source link

When using loop, sleep is not upheld. #34

Closed chipzzz closed 4 years ago

chipzzz commented 4 years ago

I am using latest within a Kubernetes set up,

          command: ["flog"]
          args: ["-t", "log", "-w", "-o", "/var/log/test-log.log", "-n", "1000", "-s", "10", "-l"]

In order to keep the container running, I am using loop so that flog keeps getting executed. I noticed when using loop, no matter what sleep number I specify it does not seem like it's being upheld when using loop. I see events coming in hundreds of thousands as the program is not pausing, ( not upholding the sleep flag).

If I remove loop, the number and sleep cycle I specify seems to be working, however the container dies and rebuilds and it is in a crash loop.

I'm hoping loop can be fixed to be properly aligned with sleep.

chipzzz commented 4 years ago

I was able to achieve consistent log counts with delay, it must be noted that delay flag has to be places before sleep flag otherwise it will not work (this is where I got stuck and gave up on delay flag)

Not sure that it matters but both sleep and delay flags are floats, added .0 accordingly.

["-d", "1.0", "-s", "1.0", "-n", "1000", "-t", "log", "-o", "/var/log/test-log.log", "-l"]