Move main graph to new API v2 endpoint#6152
Open
RobertJoonas wants to merge 22 commits intomasterfrom
Open
Conversation
This is currently only used by the main graph, which is going to move to a new endpoint in this PR. * The CSV export is currently ignoring comparisons * the `&compare=previous_period` option in Stats API v1 is ignored by the timeseries endpoint
* For time:hour and time:minute, sessions are smeared using time_slots. The fix is to filter out time_slots that fall outside of the utc boundaries * For any other time dimension, there's no session smearing, but since sessions are put into time buckets by the last event timestamps, the query might return buckets that are outside of the query time range. The fix is to clamp those sessions into the last bucket instead.
b75763c to
e643b00
Compare
This reverts commit 70dbfaa.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
include.time_labelsis set, also includemeta.time_label_result_indices(right next tometa.time_labelsthemselves). This helps to avoid searching for rows corresponding to a time label on the client side.New comparison response format for timeseries
Unlike comparisons with empty dimensions or non-time dimensions, the number of dimension groups returned for a time dimension query is not guaranteed to match between original and comparison results. The simplest example: a custom period comparison.
In order for the response to indicate which original group corresponds to which comparison group, we had two options:
1. Stick with the current response structure where a comparison map is merged into each row of results
This was the initial solution that this PR tried to implement. The reason this approach seemed better was keeping a single response structure of comparisons. For non-time dimension queries, this format makes perfect sense and is easy to read.
However, the following cons have contributed to choosing option 2 instead:
resultsandcomparison_resultspadding the shorter result set withnils if necessary.results(when comparing)2. Return
comparison_resultsas a separate response field when a time dimension is involvedEven though a separate form of returning comparisons seems inconsistent , it makes much more sense for comparison results to be separated in timeseries as it alleviates all the cons mentioned in option 1.
Tests
Changelog
Documentation
Dark mode