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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding co-occurrence metrics to facilitate finding related packages #1218

Open
ruslandoga opened this issue Nov 11, 2023 · 2 comments
Open

Comments

@ruslandoga
Copy link

ruslandoga commented Nov 11, 2023

馃憢

Related ex_doc issue: elixir-lang/ex_doc#1811

Would it be possible to calculate and persist and make available through the API the co-occurrence metrics for packages from the fastly logs? For example, Phoenix and Ecto are downloaded together quite often and would probably have a high co-occurrence statistic and that would make it possible to prioritize ecto search results when something like "query" is searched from hexdocs.pm/phoenix

@ericmj
Copy link
Member

ericmj commented Nov 20, 2023

I think we would have to log additional data to make that possible. Today the client doesn't send any information that would tell us that two requests are from the same mix deps.get other than possibly the IP address.

The first step would be to add a session identifier to requests made by https://github.com/hexpm/hex_core. This should probably be done by generating a UUID on hex_core start up and adding it as a header to all requests.

After that we can update the fastly logger to include the header in the log lines and update the stats collection job to check the header.

@ruslandoga
Copy link
Author

ruslandoga commented Nov 21, 2023

Right, I was thinking about identifying the sessions as "requests made from the same IP address within a minute of each other". Having an actual session identifier would be great.

The first step would be to add a session identifier to requests made by https://github.com/hexpm/hex_core. This should probably be done by generating a UUID on hex_core start up and adding it as a header to all requests.

I'd be happy to work on this! I'll try to get something working by the end of the week.

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