-
-
Notifications
You must be signed in to change notification settings - Fork 336
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
Introduce ProcessRefreshKind::Thread #1436
base: master
Are you sure you want to change the base?
Conversation
A lot of extra docs to explain what this |
Also: the new setting is still disabled by default. |
No its not. In default we have |
@GuillaumeGomez do you know why this task consistently fails? https://github.com/GuillaumeGomez/sysinfo/pull/1436/checks?check_run_id=36373553137 Doesnt seem to be related to my code change. its failing in rust setup. |
Well, don't trust me, trust the code. Try: let x = ProcessRefreshKind::new();
assert!(x.tasks()); ExplanationsIt's because you need to implement by hand the Please add a unit test with the code above too please.
Yes, it's "normal". Rust's freebsd support is not great and there are often random failures depending on the nightly. |
I see what you mean but ProcessRefreshKind does not have a
Bummer :( This shouldnt block me from merging this PR thought right? |
I actually wanted to write
Nah, not an issue. MacOS CI also randomly fails on |
@GuillaumeGomez can i get an approval on this if everything looks good. This is blocking us from going into production in its current state. |
Well, neither you or your company is sponsoring my work so I have to admit it's not really one of my priorities. ^^' |
Co-authored-by: Guillaume Gomez <[email protected]>
Co-authored-by: Guillaume Gomez <[email protected]>
Going through your page, looks like my company was a previous sponsor. DM me and i would like to find out how you got sponsored before and see if I can re-engage the same path. Apologies, I'm super new to OS contributions. |
/// dirs. This makes the refresh mechanism a lot slower depending on the number of tasks | ||
/// each process has. | ||
/// | ||
/// If you don't care about tasks information, use `ProcessRefreshKind::everything().without_thread()` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
without_tasks()
|
||
s.refresh_processes(ProcessesToUpdate::All, true); | ||
// At this point we know the thread is visible in the system's process/tasks list. | ||
// Lets validate a few more things: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Let's"
// Lets validate a few more things: | ||
// * ProcessRefreshKind::nothing() should have thread information. | ||
// * ProcessRefreshKind::nothing().with_tasks() should have thread information. | ||
// * ProcessRefreshKind::nothing().without_tasks() should have thread information. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"shouldn't", "task information"
// At this point we know the thread is visible in the system's process/tasks list. | ||
// Lets validate a few more things: | ||
// * ProcessRefreshKind::nothing() should have thread information. | ||
// * ProcessRefreshKind::nothing().with_tasks() should have thread information. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"task information"
// * ProcessRefreshKind::nothing().with_tasks() should have thread information. | ||
// * ProcessRefreshKind::nothing().without_tasks() should have thread information. | ||
// * ProcessRefreshKind::everything() should have thread information. | ||
// * ProcessRefreshKind::everything() should have thread information. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the same line as before.
// * ProcessRefreshKind::nothing() should have thread information. | ||
// * ProcessRefreshKind::nothing().with_tasks() should have thread information. | ||
// * ProcessRefreshKind::nothing().without_tasks() should have thread information. | ||
// * ProcessRefreshKind::everything() should have thread information. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"task information"
/// Creates a new `ProcessRefreshKind` with every refresh set to `false`, except for `tasks` | ||
/// This is because by default, [`Process`] was fetching all tasks and we want to keep this | ||
/// behavior. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Creates a new `ProcessRefreshKind` with every refresh set to `false`, except for `tasks` | |
/// This is because by default, [`Process`] was fetching all tasks and we want to keep this | |
/// behavior. | |
/// Creates a new `ProcessRefreshKind` with every refresh set to `false`, except for `tasks`. | |
/// By default, we want to list all processes and tasks are considered processes on their own | |
/// in linux so we still fetch them by default. However, the processes information are not | |
/// refreshed. |
/// Default implementation for [`ProcessRefreshKind`]. | ||
/// Sets everything to default values except for `tasks` which is set to `true`. | ||
/// This is because by default, a [`Process`] was fetching all tasks and we want to keep this | ||
/// behavior. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Default implementation for [`ProcessRefreshKind`]. | |
/// Sets everything to default values except for `tasks` which is set to `true`. | |
/// This is because by default, a [`Process`] was fetching all tasks and we want to keep this | |
/// behavior. | |
/// Creates a new `ProcessRefreshKind` with every refresh set to `false`, except for `tasks`. | |
/// By default, we want to list all processes and tasks are considered processes on their own | |
/// in linux so we still fetch them by default. However, the processes information are not | |
/// refreshed. |
I think this is the last review round before merging (if I didn't forget anything hopefully). |
No description provided.