rust-lang / rust-lang/rustc-perf

Error message is confusing when piece of query has no data for it or is misspelled

Open
#901 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

C-improvement P-low
Dominant language
Rust
Stars
733
Forks
189
Avg merge
10h 52m
Merged PRs (30d)
43

Description

I ran into an issue where I was querying for "instructions:u" on local data where the instructions data had not been collected (presumably due to missing support in WSL). The error message returned from the API was confusing and didn't help me quickly realize what was happening.

The current error comes directly from the intern crate. It was "ProcessStatistic does not have instructions:u as a valid value". This happens when we try to parse the string "instructions:u" as a ProcessStatistic and there is not interned string.

intern seems to be a fairly independent crate so changing the error message there seems to not be the right move. Instead we can change the error when parsing ProcessStatistic and the other query pieces (using map_err) to something like: "'instructions:u' is not a valid statistic. Ensure that 'instructions:u' is spelled correctly and data related to it has been stored in the database.".

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the parsing of ProcessStatistic and the other query pieces, where the issue suggests using map_err instead of changing the intern crate. Trace how the API surfaces these parse failures, then make invalid or unavailable statistics produce a message that identifies the statistic, suggests checking its spelling, and explains that its data must be stored in the database.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.