Compare commits
2 Commits
6bfba61742
...
fix/jitter
| Author | SHA1 | Date | |
|---|---|---|---|
| c858df25ea | |||
| d4c485a854 |
@@ -27,6 +27,14 @@ std::chrono::milliseconds Producer::compute_delay(SysfsStatus status) const
|
||||
{ // when error = temp too high
|
||||
return hot;
|
||||
}
|
||||
if (status == SysfsStatus::Enabled)
|
||||
{
|
||||
static std::random_device rd;
|
||||
static std::mt19937 gen(rd());
|
||||
std::uniform_int_distribution<int> dist(1000,5000); //jittered around 3s with +-2s
|
||||
|
||||
return std::chrono::milliseconds(dist(gen));
|
||||
}
|
||||
else
|
||||
{
|
||||
return standard;
|
||||
|
||||
Reference in New Issue
Block a user