dart-lang / pub-dev

The pub.dev website
https://pub.dev
BSD 3-Clause "New" or "Revised" License
796 stars 146 forks source link

Improved metrics: Measure and report the download count #2714

Open ShivamArora opened 5 years ago

ShivamArora commented 5 years ago

As a developer and owner of a package, I would like to see the download stats for my package.

The npm package repository on npmjs.com provides the download statistics for the libraries.

I would like to see the same happening on the pub.dev website.

This will help in getting to know how many people/projects are using my package.

Screenshot 2019-08-28 at 4 01 18 PM

jonasfj commented 5 years ago

See also https://github.com/dart-lang/pub-dev/issues/1229.


Defining the download count is a bit non-trivial though. Should we remove bots (how), if not travis-ci will dominate the result. Do we want to measure downloads, or number of times a client asked if a newer version was available?

I think we ultimately want a more transparent popularity metric along the lines of download count.

ShivamArora commented 5 years ago

I don't think asking for a newer version should count as a download.

By download count, I meant to measure the downloads made by different projects using the pub tool.

However, for a reference, can we check out how npm defines their download count?

jonasfj commented 5 years ago

By download count, I meant to measure the downloads made by different projects using the pub tool.

I only download a package to my machine once, then it's in my ~/.pub-cache/, no matter how many projects I used said package in.

However, if my travis setup isn't configured to cache it can download the package for every single test run.

ShivamArora commented 5 years ago

I only download a package to my machine once, then it's in my ~/.pub-cache/, no matter how many projects I used said package in.

The same happens for npm packages as well as they are stored in node_modules.

It would be worth if we can check out how the npm repository is measuring the download count of packages.

isoos commented 5 years ago

It would be worth if we can check out how the npm repository is measuring the download count of packages.

https://blog.npmjs.org/post/92574016600/numeric-precision-matters-how-npm-download-counts

The main gist:

npm’s download stats are naïve by design: they are simply a count of the number of HTTP 200 responses we served that were tarball files, i.e. packages. This means the number includes:

  • automated build servers
  • downloads by mirrors
  • robots that download every package for analysis

[...]

So the count of “downloads” is much larger than the number of people who typed “npm install yourpackage” on any given day.

[...]

Bottom line: most packages get a trickle of downloads every day, and that’s not necessarily indicative that they’re being actively used. Only if your package is getting > 50 downloads/day can you be sure you’re seeing signal instead of noise. You will also get a burst of downloads whenever you publish a new package or a version of that package, because all the mirrors will download it.

ShivamArora commented 5 years ago

@isoos Do you have anything in mind regarding what could be the best approach to measure the download count?

isoos commented 5 years ago

Do you have anything in mind regarding what could be the best approach to measure the download count?

@ShivamArora: I don't think there is a good approach to it, by its nature, it cannot be solved correctly. Our current popularity metric is a proxy of the total download count. A lot of thought went into it, e.g. how to filter CI systems automatically, how to balance the long-tail distribution, and I believe it is much closer to the truth than the "feel-good" download counts.

Having said that, I think it can be a valid goal to expose a few more metrics that are also a proxy for popularity, because maybe a single metric won't ever solve it:

We are also planning to introduce some kind of community rating that also provides feedback about the quality and/or use of the package.

Note: we don't have any strict schedule for the above, and can't commit to it, but really open to ideas related to these.

ShivamArora commented 5 years ago

@isoos Cool.

I agree with the point that we should expose a few more metrics.

Having the feature of community rating would be pretty good. But don't limit it just to rating include some reviews as well.

Community Ratings and Reviews would be helpful for anyone to know about the quality of the package and what others feel about the package after using it.

Apart from that I would suggest another metric, if that's possible, which should provide information about the Documentation Quality.

Since good documentation is a lot more important than just using the package.

bsutton commented 4 years ago

@isoos

Our current popularity metric is a proxy of the total download count. A lot of thought went into it, e.g. how to filter CI systems automatically, how to balance the long-tail distribution, and I believe it is much closer to the truth than the "feel-good" download counts.

As a publisher I'm not certain what 'truth' you are talking about, as the current '0-100' popularity gives me no useful information. Whilst I agree that it would be nice to filter out CI/bots etc its probably not a reality. As such a raw count actually is probably the best approach.

Raw counts will give a sense of scale. The popularity score gives no sense of scale. If I've only got 10 users then its probably time to dump the project. If there is 10K users then I'm been appreciated and its worth continuing the work :)

It is particularly unhelpful that the current metric is undocumented. Is the range linear or exponential? Is it somehow relative to other projects?

I have a feeling that the team tried to be too clever and we have ended up with something far worse than the raw numbers.

mit-mit commented 4 years ago

This is actively being considered. We're looking into options for how to get a representative count of downloads / pub gets, even for cases where the package is still in the local cache.

bsutton commented 4 years ago

@mit-mit 👍

MaikuB commented 4 years ago

I don't know how many authors are publishing prerelease versions but seeing download numbers for them could help authors get a sense of the number of users that helping to test out these versions. This is turn could assist with making a decision on if it's ready for a stable release

AKushWarrior commented 4 years ago

@mit-mit I think that when a user runs pub get, pub can check the differences from the previous pubspec.lock (what packages have been added/deleted) and then push those changes to the server, which applies them to the global count of usages for that package. That still doesn't solve the Travis CI issue, but it does solve the cache issue.

I know you guys have looked at NPM. https://crates.io (Rust's central package repository) also provides download stats, so it might be worth checking out how they do it.

MaikuB commented 4 years ago

To follow up on what I had mentioned, I had changes for a plugin that was in prerelease for a number of months that was then promoted to stable having figured it had been given enough time for the community to help test and give feedback. A couple of weeks later a bug has been found. IAs this is a plugin that's used by lot of the community, at least based on what I can infer from pub.dev and GitHub, I can only assume the prereleases hadn't gotten much usage to begin with. If there is some concern around displaying download counts publicly, perhaps consider having it visible only to the authors of the plugin. Though part of what would help in this particularly is to know the amount of downloads for a particular version. An example that does this is https://www.nuget.org/

Jjagg commented 3 years ago

If it's feasible, I have a use case where it would be very helpful to know why a package was installed, i.e. whether it was a direct dependency or transitive through package x (in percentages).

jayoung-lee commented 3 years ago

+1 to more straightforward metrics.

In the recent user study, users used the popularity score and Pub Points for decision making (e.g., skip packages with <80% popularity), but they didn't necessary understood the scores when using them.

AKushWarrior commented 3 years ago

+1 to more straightforward metrics.

In the recent user study, users used the popularity score and Pub Points for decision making (e.g., skip packages with <80% popularity), but they didn't necessary understood the scores when using them.

Well, nobody understands the scores, because they're not transparent. I don't see the issue with just exposing the raw metrics: that's both more useful and more informative.

pichillilorenzo commented 3 years ago

Is there any news or ETA about it? Thanks!

sigurdm commented 3 years ago

No - we don't have an ETA for this yet - but it is something we want to get to do.

maxxfrazer commented 2 years ago

Any updates on when this can be added as a feature? Even if it's just an API like npm has and not shown on the package page, it's really useful to all of us to know how a package's developer base is growing (or shrinking!)

mit-mit commented 2 years ago

This is actively being worked on; we're adding various telemetry to enable this. But it will take a while before this is complete enough that we can start displaying it.

gsmental commented 2 years ago

hurry up bro,

maxxfrazer commented 2 years ago

hurry up bro,

steady on, these devs don't owe you or me anything… respectfully show your interest in this feature and move on.

tashi146 commented 2 years ago

If the bot is what we are worried about for stats such as download count and all then at least only author should have metric option to see how package is doing. I don't think author will create bot see him self getting lot of download etc.

Thanks dart teams

xr0master commented 1 year ago

I don't think author will create bot see him self getting lot of download etc.

Why not? The downloads wrapping is a very popular cheating. The more downloads, the more often users choose your package, the more popular you become, and the more investments you get.

I wish good luck to the team to find a solution.

alexobviously commented 1 year ago

Any progress on this?

ishaileshmishra commented 1 year ago

Checking if we have any update on the dart package statitics. 💥

maxxfrazer commented 1 year ago

@mit-mit is this something still on the near-term roadmap?

incrediblezayed commented 1 year ago

+1

therdm commented 1 year ago

+1

iapicca commented 1 year ago

@mit-mit this feature could help sniffing "likes" from bots

#

Why not? The downloads wrapping is a very popular cheating. The more downloads, the more often users choose your package, the more popular you become, and the more investments you get.

I wish good luck to the team to find a solution.

@xr0master at the very least it will unveil if the issue of bots existed so far (I think so)

PlaxXOnline commented 1 year ago

+1

IgorGZd commented 1 year ago

+1

edugemini commented 1 year ago

+1

ueman commented 1 year ago

Please don't post +1. Use the 👍 emoji on the original post to vote it up. Comments without content don't add to the discussion and don't help prioritizing this issue. Adding a thumbs up does so.

iapicca commented 1 year ago

This is actively being worked on; we're adding various telemetry to enable this. But it will take a while before this is complete enough that we can start displaying it.

@mit-mit does your comment still reflect the status of the issue?

mit-mit commented 1 year ago

Yes, we're still working on it.

renancaraujo commented 1 year ago

Hello,

I wanted to chime in with the insight on how game changer this would be for us at @VeryGoodOpenSource

Two of the most popular packages that we have, very_good_cli and dart_frog_cli have thousands of reports usages (trough the now dead usage package) and still score relatively low in the current "popularity" metric.

Every metric has a caveat, and I think we can live with the ones under the possible "downloads". The real impact of these caveats relies more on how you communicate it to the people reading the chart rather than making it available or not.

As a follow-up on making "downloads" available as a metric, we can think on some capillaries that could increase the quality of life of most dart developers:

Example of a download chart on crates.io, where the "version" capilarity is explored:

Screenshot 2023-09-27 at 22 40 45

bsutton commented 1 year ago

I will add to @renancaraujo comments. The version details would be particularly interesting as we could then see when a particular version of Dart no longer needs to be supported. We currently support from dart 2.12, but how many people are still using it? This level of knowledge would help make our development more streamlined.

Blacktaler commented 11 months ago

It would be worth if we can check out how the npm repository is measuring the download count of packages.

https://blog.npmjs.org/post/92574016600/numeric-precision-matters-how-npm-download-counts

The main gist:

npm’s download stats are naïve by design: they are simply a count of the number of HTTP 200 responses we served that were tarball files, i.e. packages. This means the number includes:

  • automated build servers
  • downloads by mirrors
  • robots that download every package for analysis

[...]

So the count of “downloads” is much larger than the number of people who typed “npm install yourpackage” on any given day.

[...]

Bottom line: most packages get a trickle of downloads every day, and that’s not necessarily indicative that they’re being actively used. Only if your package is getting > 50 downloads/day can you be sure you’re seeing signal instead of noise. You will also get a burst of downloads whenever you publish a new package or a version of that package, because all the mirrors will download it.

Ok, it seems a little bit harsh. But at least, are we able to see among how many users is our package popular? For example, how many users does it mean to be popular by 100%?

Sorry if it's the exact same thing as discussed above😃

mit-mit commented 9 months ago

Assigning to @sigurdm who started investigating this

mit-mit commented 4 months ago

Status update: we're actively working on this, and hope to have improved metrics in at least preview by end of year. Sorry this is taking a while, but there are a lot of considerations to work through.

dadvir commented 3 months ago

if i can jump in, and be a bit naive and (maybe) spiritual about this, I understand the Dart comity leaders concerns regarding a well-engineered and science-like metrics. in a real-world scenario, you've your path chosen, and most of the times, clear and simple is much more better. the current scoring tells me nothing about should i use the package. this can be risky. also can be used to exploit by black hat coders. consider an engineer, architect or sec-dev-ops looking into a Dart package, at the moment he's completely blind regarding the usage of it.

npm metrics proved to be a great tool for the community to decide whether or not to use a package. the Dart way, 0-100 percentage, simply doesn't cut it.

i suggest to imply provide a number, and note your science like comment about scoring, and let the wise women and men choose what they will :)

iapicca commented 1 month ago

the PR

seems to target this issue even if isn't mentioned directly

bigbott commented 1 month ago

5 years to show the known number of downloads. Ridiculous

Blacktaler commented 3 weeks ago

if i can jump in, and be a bit naive and (maybe) spiritual about this, I understand the Dart comity leaders concerns regarding a well-engineered and science-like metrics. in a real-world scenario, you've your path chosen, and most of the times, clear and simple is much more better. the current scoring tells me nothing about should i use the package. this can be risky. also can be used to exploit by black hat coders. consider an engineer, architect or sec-dev-ops looking into a Dart package, at the moment he's completely blind regarding the usage of it.

npm metrics proved to be a great tool for the community to decide whether or not to use a package. the Dart way, 0-100 percentage, simply doesn't cut it.

i suggest to imply provide a number, and note your science like comment about scoring, and let the wise women and men choose what they will :)

I'm not quite sure that, what you said would be correct way too. Because there are rare packages/plugins, which are not used commonly, but necessary and not dangerous. So to work by your opinion they should add feedback section rather than likes and percentages.

mit-mit commented 3 weeks ago

seems to target this issue even if isn't mentioned directly

Yes, we're making good progress and should have some updates soon.

bigbott commented 2 weeks ago

5 years to show the known number of downloads. Ridiculous

Someone marked this my comment as abuse. I think we have a different definition of the word abuse.

The fact that you did not fix issue opened 5 years ago, which can be fixed literally in 5 minutes is abuse.

orestesgaolin commented 5 days ago

The experimental flag seems to be available now under pub.dev/experimental

screenshot_20241119_094800 screenshot_20241119_094824 screenshot_20241119_094930

One thing that I'm not clear is for what time range the total download count is shown. Only after hovering over the number in the side bar you can see it's in the last 30 days. screenshot_20241119_095034

Perhaps it should also be written openly on the Scores subpage

screenshot_20241119_095110

iapicca commented 5 days ago

The experimental flag seems to be available now under pub.dev/experimental

@orestesgaolin you made my day! this could be a (or better, the final) nail in the coffin for getx popularity