Skip to content
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

Filter plugin installs data #685

Closed
Tracked by #701
klai95 opened this issue Oct 6, 2022 · 12 comments · Fixed by #713
Closed
Tracked by #701

Filter plugin installs data #685

klai95 opened this issue Oct 6, 2022 · 12 comments · Fixed by #713
Assignees
Labels

Comments

@klai95
Copy link
Contributor

klai95 commented Oct 6, 2022

For the /activity/<plugin> endpoint, we should filter installs data to the past n months, where n can be specified by the frontend, but otherwise defaults to 12. Additionally, the current month's data is not returned, so the data would always end at the previous month (e.g. in October 2022, we would return available data for October 2021 - September 2022).

Additional notes

Currently on staging, the data is bunched together as the frontend is not set up to handle more than 12 data points:

Screen Shot 2022-10-06 at 4 17 03 PM

@klai95 klai95 added the bug Something isn't working label Oct 6, 2022
@richaagarwal richaagarwal moved this to Backlog in napari hub backlog Oct 6, 2022
@codemonkey800
Copy link
Collaborator

specifically, it should be the last 12 months. if the plugin is less than 12 months old, it should still show all 12 data points but with a null y value for the months where it didn't exist. for example:

"points": [
{
"x": 1627801200000,
"y": null
},
{
"x": 1630479600000,
"y": null
},
{
"x": 1633071600000,
"y": null
},
{
"x": 1635750000000,
"y": null
},
{
"x": 1638345600000,
"y": null
},
{
"x": 1641024000000,
"y": null
},
{
"x": 1643702400000,
"y": 6
},
{
"x": 1646121600000,
"y": 2
},
{
"x": 1648796400000,
"y": 1
},
{
"x": 1651388400000,
"y": 3
},
{
"x": 1654066800000,
"y": 2
},
{
"x": 1656658800000,
"y": 1
}
],

@klai95
Copy link
Contributor Author

klai95 commented Oct 19, 2022

@manasaV3 @codemonkey800 and me have just discussed the following points and we hope to get feedback from @richaagarwal about them:

Problem: Currently, the activity dashboard implementation plan for displaying plugin installs chart is to include the data points from the past 12 months. However, the issue with this approach is that it is not flexible. For example, a user may only want to look at all data points in 2020, but based on the current method the user would not be able to do so.

Solution: To solve this problem, we can build APIs that are more extensible and flexible by introducing additional parameters in the URL, namely, the start date and end date.

Note: If there is a need to avoid malicious attacks, we cab set a limit as a param to avoid users from hitting our endpoints too many times, or even just limiting the time period between start and end months to no more than 12 months. I can see how this work could help drive frontend-to-backend shared data schema efforts as well.

@richaagarwal richaagarwal changed the title Formatting issue with displaying plugin installs chart Filter plugin installs data Oct 20, 2022
@richaagarwal richaagarwal removed the bug Something isn't working label Oct 20, 2022
@richaagarwal
Copy link
Collaborator

@klai95 Thanks for noting this, Kevin! I've updated the issue's description above. Let me know if that captures this. In the future, we can certainly look into accommodating specific start and end dates as well.

I also removed the bug label as this work is not yet released to production :)

@klai95
Copy link
Contributor Author

klai95 commented Oct 21, 2022

@klai95 Thanks for noting this, Kevin! I've updated the issue's description above. Let me know if that captures this. In the future, we can certainly look into accommodating specific start and end dates as well.

I also removed the bug label as this work is not yet released to production :)

Just two clarifying questions:

(1) Does this mean we are set on not displaying the current month's data? I know during the meeting some folks were talking about prediction models, so just want to get some clarity!

(2) When you say we should filter installs data to the past n months, is there an upper bound for what n could be? For example, if someone requests for a value of 100 for n, do we have a set limit (say arbitrarily 36 just for example) that cannot be exceeded to limit the amount of data that needs to be returned?

@richaagarwal

@richaagarwal
Copy link
Collaborator

@klai95 For our initial launch (what we've been referring to internally as P0 work), we won't be displaying the current month's data. In follow-up work, there will likely be changes to what & how we display the data.

We haven't yet discussed this particular ticket in a team meeting so it's possible there will be some more changes - nothing is set in stone at the moment, but we'll finalize the criteria for this ticket once we bring it into a sprint. At this time, I don't see too much value in adding an upper limit, but we can discuss more in refinement.

@richaagarwal
Copy link
Collaborator

Just a heads up that we may need to clarify whether to distinguish plugins that were released in the current month (in which case we'd check the plugin's release date and return data accordingly) vs. older plugins that happen to have zero installs - depending on the outcome of that, it may impact the work in this ticket (we could open up a separate issue, but just wanted to flag here). Let's clarify in sprint planning today. cc @klai95 @neuromusic @codemonkey800 @liaprins-czi

@richaagarwal
Copy link
Collaborator

@klai95 @codemonkey800 To summarize what was discussed in sprint planning today - we will move forward with what's captured in Lia's designs and show a special message for when a plugin is new (e.g. released in the current month), and otherwise show data as defined in this ticket. So I will let you two work out what the back-end should return so that the front-end knows it is a new plugin and to display the "There is not yet enough data..." message per the design.

@klai95
Copy link
Contributor Author

klai95 commented Nov 1, 2022

@richaagarwal On the frontend @codemonkey800 uses null to show gaps, and so on the backend the months that have no installs will take the values of None. It is also worth noting that, by doing so, we can differentiate months that actually have no installs v.s. months that have gaps.

@richaagarwal
Copy link
Collaborator

@klai95 @codemonkey800 Quick clarification - we actually never see zeros/no install data in Ben's table, because there's only a row for an item if it was an install. So unfortunately we don't have any way to meaningfully distinguish between "gaps" and zero installs. Based on discussions we've had so far, it seems we are comfortable inferring these as zero installs, so we should probably show this as zeroes in the UI as well.

@klai95
Copy link
Contributor Author

klai95 commented Nov 1, 2022

@klai95 @codemonkey800 Quick clarification - we actually never see zeros/no install data in Ben's table, because there's only a row for an item if it was an install. So unfortunately we don't have any way to meaningfully distinguish between "gaps" and zero installs. Based on discussions we've had so far, it seems we are comfortable inferring these as zero installs, so we should probably show this as zeroes in the UI as well.

@codemonkey800 Just some clarification, we would still want to return None instead of 0 in this case right?

@codemonkey800
Copy link
Collaborator

yeah it would be ideal to return None if there is a gap. I think the main use case is for when a plugin is less than a year old:

image

in this case, there would be points for October - January, but the y values would be None.

another option we could do is have the backend only return the amount of points it has. so if there's only 6 data points, and we request 12, then just send 6. on the frontend we can fill in the remaining data points for the rest of the months and use y: null for the gaps

@klai95
Copy link
Contributor Author

klai95 commented Nov 1, 2022

yeah it would be ideal to return None if there is a gap. I think the main use case is for when a plugin is less than a year old:

image

in this case, there would be points for October - January, but the y values would be None.

another option we could do is have the backend only return the amount of points it has. so if there's only 6 data points, and we request 12, then just send 6. on the frontend we can fill in the remaining data points for the rest of the months and use y: null for the gaps

The second option is what we had before, so I think at this point perhaps we can just go with option 1?

Repository owner moved this from In Review to Done in napari hub backlog Nov 14, 2022
@richaagarwal richaagarwal moved this from Done to Done (all-time) in napari hub backlog Nov 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants