Calculates the parameters to use for late aggregation.
Since we're in the process of transitioning from an RRD-world, most queries won't
contain a specified interval or heartbeat. For this reason, we need to derive sensible
values that will allow users to visualize the data on the graphs without too many NaNs.
The given step size will be variable based on the time range and the pixel width of the
graph, so we need to derive the interval and heartbeat accordingly.
Let S = step, I = interval and H = heartbeat, the constraints are as follows:
0 < S
0 < I
0 < H
S = aI for some integer a >= 2
H = bI for some integer b >= 2
While achieving these constraints, we also want to optimize for:
min(|S - S*|)
where S* is the user supplied step and S is the effective step.