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

Filter by other fields #8115

Closed
adrianlzt opened this issue Sep 28, 2021 · 2 comments
Closed

Filter by other fields #8115

adrianlzt opened this issue Sep 28, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@adrianlzt
Copy link

Currently it is only possible to filter by name.

Would be very useful to be able to filter by other fields like state or cmdline.

@brianc118 brianc118 added the enhancement New feature or request label Oct 6, 2021
@brianc118
Copy link
Contributor

Yeah this sounds like a good idea - there have been times where I've wanted this as well

facebook-github-bot pushed a commit that referenced this issue Aug 25, 2022
Summary:
## Task Overview (both part 1 & part 2)
Support a filter by selected column/each field instead of filtering by name. A view can have multiple tabs and each tab has multiple fields. For example process view has "General" "CPU" "MEM" and "I/O" tabs which all display the same rows but different fields for the model depending on which tab you are on.

A filter can be applied to only one column/field at a time and it is enabled for string columns (not numeric yet).  A future improvement would be to enable filtering for multiple columns at once and allowing filtering on numeric columns (>, <, and = ).

## Part 1 of Task
With this current feature, `filter` and `filter_cache_for_zoom` each hold a pair that maps `FieldId -> String`. In the future, to support multiple filters, we might replace this with a map of all fields -> filter strings.
This pair will be correctly updated with the selected FieldId and the filter string whenever the user filters. Currently, there should be no change to the filtering behavior from the user's pov. Filtering the rows based on FieldId will be introduced in part 2

## Context

See #8115

The desired behavior is this: if we filter by a particular field only present in a one of the tabs, we will keep the filter even when we switch tabs.
For example:
1. Enter process view on general tab
2. Select "State" column (press '.' a few times)
3. Filter with "IDLE" state
4. Enter CPU view (<TAB>)
5. We should observe the same processes/rows are displayed as we keep holding <TAB> to move across the process view tabs.

Reviewed By: brianc118

Differential Revision: D38760054

fbshipit-source-id: 2cf50b74559290a3bcf5019a1d0954c6f5fb764b
facebook-github-bot pushed a commit that referenced this issue Aug 25, 2022
Summary:
## Task Overview (both part 1 & part 2)
Support a filter by selected column/each field instead of filtering by name. A view can have multiple tabs and each tab has multiple fields. For example process view has "General" "CPU" "MEM" and "I/O" tabs which all display the same rows but different fields for the model depending on which tab you are on.
A filter can be applied to only one column/field at a time and it is enabled for string columns (not numeric yet).  A future improvement would be to enable filtering for multiple columns at once and allowing filtering on numeric columns (>, <, and = ).

## Part 2 of Task
This diff introduces the ability to filter on any column. To filter on a specific column, select a column by pressing '.' or ',' and then filter
- command palette should list both the filter column and filter string
- filtering on columns should work with all the views
- the command palette is updated when the filter is updated or the view is changed
- filter popup should say "Filter by {selected col name}".

## Context

See #8115

The desired behavior is this: if we filter by a particular field only present in a one of the tabs, we will keep the filter even when we switch tabs.
For example:
1. Enter process view on general tab
2. Select "State" column (press '.' a few times)
3. Filter with "IDLE" state
4. Enter CPU view (<TAB>)
5. We should observe the same processes/rows are displayed as we keep holding <TAB> to move across the process view tabs.

Reviewed By: brianc118

Differential Revision: D38835737

fbshipit-source-id: fafff81c16f1c8a1295d63b6bda9bed7e1c4daae
@brianc118
Copy link
Contributor

This should have been addressed by the above commits. We can probably extent this in the future to support a filter per column rather (#8173).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants