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

Change Request: Add rule performance dashboard #16690

Closed
1 task done
mnkiefer opened this issue Dec 22, 2022 · 14 comments
Closed
1 task done

Change Request: Add rule performance dashboard #16690

mnkiefer opened this issue Dec 22, 2022 · 14 comments
Assignees
Labels
core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint formatter Relates to the formatters bundled with ESLint
Projects

Comments

@mnkiefer
Copy link
Contributor

mnkiefer commented Dec 22, 2022

ESLint version

v8.12.0

What problem do you want to solve?

Analysing rule performance currently requires additional scripting to collect/extract more granular timing data (lint time per file per rule):

  1. Running ESLint per rule, per file and then collecting the file/rule time data output:
TIMING=1 DEBUG=eslint:cli-engine eslint --no-eslintrc --rule ... file
  1. Doing a single ESLint run on all files and then extracting the file/rule time data output:
TIMING=ALL DEBUG=eslint:cli-engine eslint ... files

In addition, one needs to create an overview for an effective presentation of the results.

What do you think is the correct solution?

It would be more convenient and shareable to have:

  1. the timing data exposed to the formatters (when TIMING is used)
  2. a built-in formatter for that data [optional]

To demonstrate this, here is a sample implementation where (1) ESLint added the timing data (lintOrder, lintTime, lintTimePerRule to the LintResult object) and (2) the formatter html-charts has been applied, which embeds the already established html formatter into a dashboard along with two charts on rule performance:

timing

  • The overview shows the overall rule performance per run (i.e. the TIMING output), as well as the individual lint time per file per rule (from the exposed timing), which can help to detect more intricate performance issues that may be overlooked otherwise (based on rule reports only). The analysis has been carried out on a set of 28 *.js files containing valid/invalid recommended rules examples provided by ESLint.

Participation

  • I am willing to submit a pull request for this change.
@mnkiefer mnkiefer added core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint triage An ESLint team member will look at this issue soon labels Dec 22, 2022
@eslint-github-bot eslint-github-bot bot added this to Needs Triage in Triage Dec 22, 2022
@kecrily kecrily added the formatter Relates to the formatters bundled with ESLint label Dec 22, 2022
@nzakas
Copy link
Member

nzakas commented Dec 27, 2022

Thanks for the suggestion. We do already have an issue open to expose timing data via the ESLint API:
#16521

We could probably expand that proposal to include timing data being passed to formatters.

In general we've been trying to avoid adding new formatters to the core, but this one is specialized enough that it might make sense.

We would need an RFC to move forward with this, and some feedback from the rest of the team would be appreciated.

@nzakas nzakas moved this from Needs Triage to Feedback Needed in Triage Dec 27, 2022
@nzakas nzakas removed the triage An ESLint team member will look at this issue soon label Dec 27, 2022
@bmish
Copy link
Sponsor Member

bmish commented Jan 6, 2023

Another related issue is #14597 (comment) where I was imagining a way to output various rule metrics (violations, disable directives, performance stats, etc). So perhaps any solution should be more general than just performance data only.

@github-actions
Copy link

Oops! It looks like we lost track of this issue. What do we want to do here? This issue will auto-close in 7 days without an update.

@github-actions github-actions bot added the Stale label Feb 13, 2023
@mnkiefer
Copy link
Contributor Author

@nzakas: I would love to contribute, please let me know how I can help to move this forward.

@Rec0iL99 Rec0iL99 removed the Stale label Feb 14, 2023
@nzakas
Copy link
Member

nzakas commented Feb 27, 2023

@mnkiefer as noted in my previous comment, the next step would be to create an RFC explaining how this feature would work.

@github-actions
Copy link

Oops! It looks like we lost track of this issue. What do we want to do here? This issue will auto-close in 7 days without an update.

@nzakas
Copy link
Member

nzakas commented Mar 30, 2023

We have an RFC opened for this, so we'll leave this issue open.

@mdjermanovic mdjermanovic removed the Stale label Sep 5, 2023
@mnkiefer
Copy link
Contributor Author

@nzakas: With the RFC merged and ESLint v9.0.0 alpha coming soon, would this be a good time to introduce this feature? If so, I would love to help/contribute here too. 👍

@bmish
Copy link
Sponsor Member

bmish commented Dec 13, 2023

Since it's not a breaking change, either before or after could work. But note that we have a lot of breaking change PRs for ESLint v9 open right now which may cause more merge conflicts than usual.

@mnkiefer
Copy link
Contributor Author

mnkiefer commented Dec 13, 2023

Since it's not a breaking change, either before or after could work.

Before would be great! I would like to use/showcase it for our CDS language ESLint plugin.

But note that we have a lot of breaking change PRs for ESLint v9 open right now which may cause more merge conflicts than usual.

That shouldn't be a problem. I currently have a PR on a fork of ESLint here. Shall I just update/keep using that or open a new one?

@nzakas
Copy link
Member

nzakas commented Dec 13, 2023

It would probably be best to hold off until after we've shipped the first alpha of v9.0.0, which will have most of the huge breaking changes. Hopefully that will be before the end of December.

@bmish
Copy link
Sponsor Member

bmish commented Dec 13, 2023

That's fair. Perhaps re-target the PR to the main ESLint repo to start getting reviewers so that it will be lined up for then?

@mnkiefer
Copy link
Contributor Author

mnkiefer commented Dec 13, 2023

That's fair. Perhaps re-target the PR to the main ESLint repo to start getting reviewers so that it will be lined up for then?

Ok, I've re-targeted the PR here. 👍

@nzakas
Copy link
Member

nzakas commented Apr 3, 2024

#17850 actually completed the work for this issue, so closing.

@nzakas nzakas closed this as completed Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint formatter Relates to the formatters bundled with ESLint
Projects
Archived in project
Triage
Feedback Needed
Development

No branches or pull requests

6 participants