-
Notifications
You must be signed in to change notification settings - Fork 105
Use deterministic method to distribute across fuzziness window #559
Comments
The reason behind the randomness was to ensure we didnt try and update all metricDefs at the same time. eg
assuming updateInterval = 21600 and the hash of our id is 1234 the metric is created at 1488825675, lastUpdate is set. for generating the hash, i recommend https://github.com/huichen/murmur as it is fast and simple to use. |
can't we simplify this formula a lot?
|
that wont work. That just updates every hash(def.id) % update interval, which could be a really small number. |
@awoods in your formula i don't understand why this:
is better than:
Wouldn't both result in an equal distribution (just upside down), but the second is more simple? |
closed by #574 |
We're currently relying on randomness, which makes this function hard to test. It would be better if we could reach distribution across the fuzziness window without involving randomness because then we could unit test if everything works as expected:
https://github.com/raintank/metrictank/blob/7cffa2d3d8eaaa2d59b07c149f5bae6deb674645/idx/cassandra/cassandra.go#L230
The text was updated successfully, but these errors were encountered: