-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
webapp: Fix handling out of range segment on graphs
Before this, graphs didn't include the segment which intersects left boundary of a graph (21 day boundary in other words). This was not visible because on 21 day range, updates are rather frequent, and the leftmost segment starts just after the boundary. However, if there's huge gap in updates, or history is deduplicated to remove points which do not have any counter changes (see #120), we'll see a missing segment. Fix that by fetching an extra data point just before the graph range.
- Loading branch information
Showing
2 changed files
with
20 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
INSERT INTO statistics_history(ts, snapshot) VALUES | ||
(now() - interval '1 day', '{"num_packages": 0, "num_problems": 0, "num_maintainers": 0, "num_metapackages": 0}'), | ||
-- point is intentionally long in the past to check whether it's handled properly producing a line | ||
(now() - interval '128 day', '{"num_packages": 0, "num_problems": 0, "num_maintainers": 0, "num_metapackages": 0}'), | ||
(now(), '{"num_packages": 10, "num_problems": 10, "num_maintainers": 10, "num_metapackages": 10}'); |