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

Create flexible map generation filtering logic #118

Open
pirj opened this issue Jul 11, 2019 · 1 comment
Open

Create flexible map generation filtering logic #118

pirj opened this issue Jul 11, 2019 · 1 comment
Labels
feature request an issue that asks for a feature which is not supported yet help wanted

Comments

@pirj
Copy link
Contributor

pirj commented Jul 11, 2019

Currently we have filtering logic literally hardcoded here: lib/crystalball/map_generator/helpers/path_filter.rb.

We need it to be a bit more flexible so we can specify a list of directories\files to filter out of profiling data.

Common use case: bundle install --standalone installs everything to vendor => falls into the data.

Expected configuration:

Crystalball::MapGenerator.start!(exclude_sources: [/\.gems/, /vendor/], exclude_specs: [/features/]) do
  # ...
end

it should exclude all sources containing .gems or vendor in paths and it should exclude the data for all spec files including features in paths

@pirj pirj added feature request an issue that asks for a feature which is not supported yet help wanted labels Jul 11, 2019
@rodrigovilina
Copy link

rodrigovilina commented Dec 3, 2020

Is no one working on this? Perhaps I can give it a try! Is the proposed example the way I should approach it 👌 ?

edit:
Looking at the code I think it would be cleaner to implement this at the strategy level, so only PathFilter and the strategies are modified. If I attempt to do it from the generator itself, I have to pass the arguments thru the MapGenerator::Configuration and then write the attribute into the strategies inside the MapGenerator::Configuration#register method.

edit:
I'll put up a PR implementing just how the example looks with comments on how I think it could be simpler if it is done right at the strategies level. Also this provides further granularity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request an issue that asks for a feature which is not supported yet help wanted
Projects
None yet
Development

No branches or pull requests

2 participants