Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Jitterer ¶
type Jitterer struct {
// contains filtered or unexported fields
}
func New ¶
New uses a string to calculate a deterministic seed for an random number generator.
The actual implementation does not really matter, we just need to condense a string into an 64-bit number. Also: cryptocraphic security is not important here, we just don't want all cron jobs to run at the same time.
func (Jitterer) Jitter ¶
Jitter takes a Cron event and adds random values for any properties not set.
The values are chosen uniformly-distributed within the validity area of the property. E.g. Minutes will be set to a value between 0 and 59. The exception is the DayOfMonth property. It will never use a value above 28, to ensure it also runs in short months.