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

Origins per project #17

Open
amark opened this issue Dec 9, 2019 · 3 comments
Open

Origins per project #17

amark opened this issue Dec 9, 2019 · 3 comments

Comments

@amark
Copy link

amark commented Dec 9, 2019

Sent an email, but I think it bounced, so copying to here: (feel free to close whenever)

If I made a PR that saves the request's origin domain to the stats, would you accept?

Why:
My open source project is getting about 2M+ hits/month now, and I know 90% of this is coming from only a couple of websites, but sometimes jsDelivr shows unexpected spikes that I have no clue who/where is using it.

Adding the request's origin domain to the stats will let you, me, and Open Source author's see which sites use their libraries the most.

Would this be ok? Thanks so much again for jsDelivr!

@MartinKolarik
Copy link
Member

Sent an email, but I think it bounced, so copying to here: (feel free to close whenever)

Hi, can you tell me what address you sent the email to?

Regarding the question, we have an open issue for this in our internal tracker as someone already asked for it. At this very moment, we're working on adding several new stats types. This one wasn't selected for development yet because it's one of the most problematic ones (many origins x many projects = huge amount of data) but we'll try to come up with a way to do it in the next weeks.

@amark
Copy link
Author

amark commented Dec 10, 2019

@MartinKolarik oh wow, you all are so responsive! Do you need any assistance on the feature? (Of course, I'm fine being lazy and waiting weeks/months/whatever for others to do the work, too, haha!)

I'm glad this was already in the list and asked about.

I replied to an old email conversation I had with you all at contact@jsdelivr.com which bounced. I also CCed the public prospectone.io one, which did not bounce.

Idea:

(A) numberOfOriginsToStore = hitsPerMonth.toString().length * 10

slick-carousel's 3B hits will save the top 100 origins, but most packages will only have top 10, or whatever X variable you think is best.

(B) if current request's origin is already in the dictionary, bump it's hit count for that origin.

(C) if current request's origin is not listed, only add to dictionary if not already full.

(D) Occasionally, evict lowest scored origins in dictionary, so that way a bunch of "first come first serve" origins with only 1 hit don't fill up or spam the list.

Eh, I'm sure it needs more improvements, or has edge cases. But just an idea for the discussion.

Hopefully this'll reduce storing waste.

@MartinKolarik
Copy link
Member

Do you need any assistance on the feature? (Of course, I'm fine being lazy and waiting weeks/months/whatever for others to do the work, too, haha!)

We'll need to do the part that stores this data ourselves. When that's done, I might ping you if you want to help us add new endpoints that serve that data here.

@MartinKolarik MartinKolarik changed the title If I PRed a Feature that saves Request's Origin Domain to Stats, Would you Accept? Origins per project Jan 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants