Fix per-app stats to handle two apps having routes with the same path… #38
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.
This PR fixes a bug which meant that the UI tool could not distinguish between two routes, in different apps, which had the same path.
The root cause of the bug was that the data returned by the Fn server (
/stats
) was simply a list of route stats, keyed by path. So this would not distinguish between two routes, in different apps, which had the same path. That bug is fixed by PR fnproject/fn#735 , which reorganises the data returned into two levels: app and then path.This PR makes use of the updated API and now will correctly handle two apps having routes with the same path.
(As an aside, when on the "all apps" chart, the lines are currently labelled only by path. They do not mention the app. Although these will display duplicate paths correctly, a use will have to navigate down to the page for the individual app to be sure which line is the one they want. An obvious change would be to display the app name as well, but I'm concerned that this would make the legend too big. That's probably worth fixing, but I think we can do that as a separate change)