-
Notifications
You must be signed in to change notification settings - Fork 322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fetching both readings for line and bar chart on meter select. #92
Comments
@jameeters I feel like users who are focused on analyzing data will switch between charts quite frequently. Each graphic representation, though representing similar information, has its unique way of doing that. So, it is really helpful for analysts to switch between graphs for the same meter. But again I am not really good about the trade offs in this case. Does reducing API requests over weigh the efficiency we can deliver to small class of our users? I am not sure about that. |
Due to the async nature of these requests, I do not believe there is any downside to requesting more data. It will not take the graph longer to display. |
There is a downside to every single operation we perform. Making the requests concurrently has absolutely no impact on the cost, only on the response time. We are still requesting data that is not for immediate use, pulling it from the database, compressing it, and caching it client side. We are doing all of this to retrieve data for which the user has expressed no desire. This will increase efficiency only if the user is almost always going to look at a line chart for meter 'a' and then a bar chart for meter 'a' with the default bar duration. (or vice-versa) Every time the user fails to do exactly this, we have made a useless request, a useless database query, and have uselessly cached the result on the user's machine. Just to summarize:
The changes I want will fetch useless data only when the user changes to bar chart and wants to view a different duration. When they switch chart types, they will wait longer to see their data. It avoids the useless request when the user wants only line charts. Most importantly, this avoids fetching data that will never be displayed, which I think is sloppy. |
I will also add that we do not get the data for 3D (due to size) until needed so this one is now separate. As we add more graphics, there is going to be a larger cost to pre-fetching. |
Fixed by PR #1113 so closing. |
Currently when the user changes which meters are selected, we fetch readings for both line and bar charts. This will be efficient if users switch between line and bar chart for the same meters more frequently than they switch between meters within a graph type. I do not think this will be the case. Until there is some reason to believe otherwise, I think a single user action should dispatch as few API requests as possible. This was briefly discussed in re #85, and I think we came to the wrong conclusion.
The text was updated successfully, but these errors were encountered: