racker/glimpse.js — pull request #166 by jverghese (2013-07-15 23:50:42+00:00)
Title: Null value tests (ready)

Adding tests for having null values in data points.

It is not harmful to have null values for data points, because they are in most cases treated as 0. This is primarily because javascript treats null as 0 in arithmetic operations.

Impact:
Nulls are rendered as 0 in line and area graphs. Since this is the current behavior, the impact is minimal but not ideal. This should however be changed in the future since nulls semantically represent no data as opposed to 0s.

Code changes are required for dealing with null values in the following cases:
Calculation of average: nulls impact the average calculation because they are treated as 0 as opposed to being ignored in the calculation.
Nulls should also be ignored in cases where we compute min, max. Things like computing max are impacted in cases where all numbers concerned are negative etc

It does not impact operations such as sum, because in these cases 0 is the identity element.