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

Alerts and Feed #2

Closed
alexeyinkin opened this issue Nov 16, 2023 · 7 comments
Closed

Alerts and Feed #2

alexeyinkin opened this issue Nov 16, 2023 · 7 comments

Comments

@alexeyinkin
Copy link

What changes to track

Popularity

With high popularity, every percent is a huge achievement. Sometimes I tweet something like 'We are +1%!', so I want to learn it as soon as it happens. Also a drop in popularity may mean call for action.

Dependencies

If a new package starts to depend on mine, it is good news. If the package is popular, I may want to announce it. If a package has dropped the dependency on mine, they may have switched to a competitor, and I need to at least ask them for feedback.

How to get them

Alerts

Ideally I want to subscribe go get that on my email as soon as that is detected.

Feed

On a package page, I want to see a feed of such events in case I want to see the summary of what happened over say the last month instead of digging through separate emails.

@Rexios80
Copy link
Owner

I've been thinking about doing alerts for a while, but that would probably mean implementing real accounts (not a problem just work I haven't gotten to around to). I already have Discord alerts running for myself on the backend, but it's not currently scalable. One issue I see with storing a feed is it could drastically increase the size of the database which I'm trying to keep within the free Realtime Database tier since this project doesn't currently have any way to generate money.

Isn't the popularity chart basically the feed for popularity changes? Do you just want a feed for other things or do you see value in having it represented twice?

@Rexios80
Copy link
Owner

Another issue I see with keeping track of dependents is that it would require an order of magnitude more API calls to collect that data. The only way I see to get that information is to do a paginated search, and some packages have a lot of pages of results.

@Rexios80
Copy link
Owner

Rexios80 commented Nov 18, 2023

I did a test and adding dependent tracking would add 58389 calls every run. There are 46931 packages so it's not that many more honestly I way overestimated. But still any piece of data we add that requires an extra API call adds at least as many API calls as there are packages.

@Rexios80
Copy link
Owner

@alexeyinkin You can now set up alerts on https://beta.pubstats.dev and they should work although I only implemented Discord webhooks for now

@Rexios80
Copy link
Owner

The alerts I implemented so far are for like count, popularity, and pub points

@Rexios80
Copy link
Owner

I implemented the rest of the alerts including dependents. I figured out how to get the dependency data from the API calls I was already making so it turned out to not be too bad. Package histories are implemented as well.

@Rexios80
Copy link
Owner

Closing since most of this is implemented. Please create additional issues for new alert methods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants