Skip to content

Unstable Feature Usage Metrics #129485

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

Open
2 of 6 tasks
yaahc opened this issue Aug 23, 2024 · 1 comment
Open
2 of 6 tasks

Unstable Feature Usage Metrics #129485

yaahc opened this issue Aug 23, 2024 · 1 comment
Labels
A-metrics Area: Metrics C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-lang Relevant to the language team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Comments

@yaahc
Copy link
Member

yaahc commented Aug 23, 2024

Unstable Feature Usage Metrics

Track unstable feature usage trends by Rust users.

Motivation

  • Support feature stabilization prioritization.
  • Helping teams know which unstable features to invest their energy into.
  • Evaluating how representative crates.io is as a sample of the rust ecosystem (will we see different patterns in crates.io feature usage vs private feature usage?)

Context

Steps / History (PROVISIONAL)

  • define the format the metrics will be stored in
  • add flag to dump unstable feature status metrics (what features exist, if they're stable or not, both for library and lang/compiler, tidy may already support this for lib features)
  • add flag to enable unstable feature usage metrics in the compiler
  • front end to display reports based on gathered usage and status metrics
  • back end to save metrics data from published crates.io crates (private data should be anonymous and stored separately once we have established the ability to gather that in a statistically relevant volume)
  • integrate with docs.rs to have it gather metrics and upload them to the backend while building newly uploaded crate versions
@yaahc yaahc added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-metrics Area: Metrics labels Aug 23, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Aug 23, 2024
@fmease fmease added C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Aug 23, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Nov 21, 2024
…tebank

unstable feature usage metrics

example output

```
test-lib on  master [?] is 📦 v0.1.0 via 🦀 v1.80.1
❯ cat src/lib.rs
───────┬───────────────────────────────────────────────────────
       │ File: src/lib.rs
───────┼───────────────────────────────────────────────────────
   1   │ #![feature(unix_set_mark)]
   2   │ pub fn add(left: u64, right: u64) -> u64 {
   3   │     left + right
   4   │ }
   5   │
   6   │ #[cfg(test)]
   7   │ mod tests {
   8   │     use super::*;
   9   │
  10   │     #[test]
  11   │     fn it_works() {
  12   │         let result = add(2, 2);
  13   │         assert_eq!(result, 4);
  14   │     }
  15   │ }
───────┴───────────────────────────────────────────────────────

test-lib on  master [?] is 📦 v0.1.0 via 🦀 v1.80.1
❯ cargo +stage1 rustc -- -Zmetrics-dir=$PWD/metrics
   Compiling test-lib v0.1.0 (/home/yaahc/tmp/test-lib)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.08s

test-lib on  master [?] is 📦 v0.1.0 via 🦀 v1.80.1
❯ cat metrics/unstable_feature_usage.json
───────┬─────────────────────────────────────────────────────────────────────
       │ File: metrics/unstable_feature_usage.json
───────┼─────────────────────────────────────────────────────────────────────
   1   │ {"lib_features":[{"symbol":"unix_set_mark"}],"lang_features":[]}
   ```

   related to rust-lang#129485
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Nov 21, 2024
Rollup merge of rust-lang#130236 - yaahc:unstable-feature-usage, r=estebank

unstable feature usage metrics

example output

```
test-lib on  master [?] is 📦 v0.1.0 via 🦀 v1.80.1
❯ cat src/lib.rs
───────┬───────────────────────────────────────────────────────
       │ File: src/lib.rs
───────┼───────────────────────────────────────────────────────
   1   │ #![feature(unix_set_mark)]
   2   │ pub fn add(left: u64, right: u64) -> u64 {
   3   │     left + right
   4   │ }
   5   │
   6   │ #[cfg(test)]
   7   │ mod tests {
   8   │     use super::*;
   9   │
  10   │     #[test]
  11   │     fn it_works() {
  12   │         let result = add(2, 2);
  13   │         assert_eq!(result, 4);
  14   │     }
  15   │ }
───────┴───────────────────────────────────────────────────────

test-lib on  master [?] is 📦 v0.1.0 via 🦀 v1.80.1
❯ cargo +stage1 rustc -- -Zmetrics-dir=$PWD/metrics
   Compiling test-lib v0.1.0 (/home/yaahc/tmp/test-lib)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.08s

test-lib on  master [?] is 📦 v0.1.0 via 🦀 v1.80.1
❯ cat metrics/unstable_feature_usage.json
───────┬─────────────────────────────────────────────────────────────────────
       │ File: metrics/unstable_feature_usage.json
───────┼─────────────────────────────────────────────────────────────────────
   1   │ {"lib_features":[{"symbol":"unix_set_mark"}],"lang_features":[]}
   ```

   related to rust-lang#129485
jhpratt added a commit to jhpratt/rust that referenced this issue Feb 4, 2025
…jieyouxu

 Add new tool for dumping feature status based on tidy

sequel to rust-lang#133514

meaning ...

supercedes rust-lang#133351

part of rust-lang#129485

r? `@jieyouxu`
cc `@estebank`
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Feb 4, 2025
Rollup merge of rust-lang#135844 - yaahc:tidy-feature-status-dump, r=jieyouxu

 Add new tool for dumping feature status based on tidy

sequel to rust-lang#133514

meaning ...

supercedes rust-lang#133351

part of rust-lang#129485

r? `@jieyouxu`
cc `@estebank`
@yaahc
Copy link
Member Author

yaahc commented Mar 3, 2025

As mentioned in rust-lang/rust-project-goals#260 (comment), I need to have more detailed discussions with t-libs and t-lang to discuss specifics of unstable feature usage metrics and the precise questions t-libs and t-lang would likely like to use this data to answer.

@rustbot labels +I-libs-nominated +T-libs +I-lang-nominated +T-lang

Related conversation: https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/unstable.20feature.20usage.20metrics

@rustbot rustbot added I-lang-nominated Nominated for discussion during a lang team meeting. I-libs-nominated Nominated for discussion during a libs team meeting. T-lang Relevant to the language team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Mar 3, 2025
jieyouxu added a commit to jieyouxu/rust that referenced this issue Mar 5, 2025
Add timestamp to unstable feature usage metrics

part of rust-lang#129485

with this we should be able to temporarily enable metrics on docs.rs to gather a nice test dataset for the initial PoC dashboard

r? `@estebank`
jieyouxu added a commit to jieyouxu/rust that referenced this issue Mar 5, 2025
Add timestamp to unstable feature usage metrics

part of rust-lang#129485

with this we should be able to temporarily enable metrics on docs.rs to gather a nice test dataset for the initial PoC dashboard

r? ``@estebank``
compiler-errors added a commit to compiler-errors/rust that referenced this issue Mar 6, 2025
Add timestamp to unstable feature usage metrics

part of rust-lang#129485

with this we should be able to temporarily enable metrics on docs.rs to gather a nice test dataset for the initial PoC dashboard

r? ```@estebank```
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Mar 7, 2025
Rollup merge of rust-lang#137827 - yaahc:timestamp-metrics, r=estebank

Add timestamp to unstable feature usage metrics

part of rust-lang#129485

with this we should be able to temporarily enable metrics on docs.rs to gather a nice test dataset for the initial PoC dashboard

r? ```@estebank```
lnicola pushed a commit to lnicola/rust-analyzer that referenced this issue Mar 10, 2025
Add timestamp to unstable feature usage metrics

part of rust-lang/rust#129485

with this we should be able to temporarily enable metrics on docs.rs to gather a nice test dataset for the initial PoC dashboard

r? ```@estebank```
github-actions bot pushed a commit to rust-lang/miri that referenced this issue Mar 11, 2025
Add timestamp to unstable feature usage metrics

part of rust-lang/rust#129485

with this we should be able to temporarily enable metrics on docs.rs to gather a nice test dataset for the initial PoC dashboard

r? ```@estebank```
@traviscross traviscross removed the I-lang-nominated Nominated for discussion during a lang team meeting. label Mar 12, 2025
@m-ou-se m-ou-se removed the I-libs-nominated Nominated for discussion during a libs team meeting. label Apr 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-metrics Area: Metrics C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-lang Relevant to the language team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants