ProcessDoctor aims to be a cross-platform process monitoring and control tool, like System Informer.
So far, only a basic process list is implemented on Windows. We are considering extending it to the other operating systems soon.
Cross-platform process monitoring and control software.
License: MIT License
ProcessDoctor aims to be a cross-platform process monitoring and control tool, like System Informer.
So far, only a basic process list is implemented on Windows. We are considering extending it to the other operating systems soon.
Currently, we always render a plain process list. We should draw a tree instead. The underlying Avalonia control supports it; it's just that I chose to not implement that in our data model among the first project features.
Suggested change: just add a ParentId
field to a ProcessViewModel
, and group them somehow on the UI side.
Currently, we rely on WMI events to list Windows processes. That API is good enough for most purposes, but it has a problem with consistency: if we only rely on process start/stop events, we may easily miss some processes.
Also, we don't show the processes started before the program startup.
I suggest that we consider using periodic requests to CreateToolhelp32Snapshot
, or periodic WMI queries of the full process list.
CreateToolhelp32Snapshot
has a downside that we won't be able to get the process' command line.
The latter I remember as being clunky, but this is yet to be checked :)
Also, if we migrate to WMI list queries instead of WMI events, we may easily miss some processes, and we don't want to miss any (we should properly register quick start+exit of a process, if possible).
Several issues with the current column structure:
See the code near this line:
Also, look for the number of this issue in the project code base.
Any logger.Error
in the app should be reported somewhere, and it should be possible to see the errors thrown.
We need to add text logging and allow the users to know where they are stored.
We have to start from somewhere, so I'd like to implement a very basic process tree on Windows and start using that daily, to see what other features to implement.
We should add process binary icons for Windows.
Currently, we don't have an icon. We should draw one.
SVG graphics are acceptable; I can organize converting to other formats on build.
Context
Windows 11
Reproducing steps:
ProcessDoctor
PrtSc
ProcessDoctor
open wininit.exe
, then services.exe
. Find svchost.exe
with the following parameters:Stack Trace
02:35:42.453 |E| ProcessDoctor.ViewModels.MainWindowViewModel | :17
| System.InvalidOperationException: Call from invalid thread
at Avalonia.Threading.Dispatcher.<VerifyAccess>g__ThrowVerifyAccess|16_0()
at Avalonia.Controls.Primitives.TreeDataGridExpanderCell.set_ShowExpander(Boolean value) in /_/src/Avalonia.Controls.TreeDataGrid/Primitives/TreeDataGridExpanderCell.cs:line 50
at Avalonia.Controls.Primitives.TreeDataGridExpanderCell.ModelPropertyChanged(Object sender, PropertyChangedEventArgs e) in /_/src/Avalonia.Controls.TreeDataGrid/Primitives/TreeDataGridExpanderCell.cs:line 138
at Avalonia.Controls.Models.TreeDataGrid.HierarchicalRow`1.set_ShowExpander(Boolean value) in /_/src/Avalonia.Controls.TreeDataGrid/Models/TreeDataGrid/HierarchicalRow.cs:line 89
at Avalonia.Controls.Models.TreeDataGrid.ShowExpanderObservable`1.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e) in /_/src/Avalonia.Controls.TreeDataGrid/Models/TreeDataGrid/ShowExpanderObservable.cs:line 87
at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
at System.Collections.ObjectModel.Collection`1.Remove(T item)
at ProcessDoctor.ViewModels.ProcessTreeViewModel.OnProcessTerminated(SystemProcess process) in D:\C#\ProcessDoctor\ProcessDoctor\ViewModels\ProcessTreeViewModel.cs:line 116
at ProcessDoctor.ViewModels.ProcessTreeViewModel.<>c__DisplayClass7_0.<.ctor>b__2() in D:\C#\ProcessDoctor\ProcessDoctor\ViewModels\ProcessTreeViewModel.cs:line 38
at JetBrains.Diagnostics.LogEx.Catch(ILog log, Action action)
See the code near this line:
Currently, we hardcode these to always have 16ร16, and the color scheme is weird. Should be improved.
We should add columns for the current process CPU/memory consumption. Optionally, support various memory metrics for Windows.
ProcessDoctor operates under condition of eventual process tree consistency, which means that for a short period of time, there could be some artifacts like processes with no parent (which will come afterwards), or two processes with the same id.
That could happen if the process enumeration is not done on the process list snapshot, but on a live process list, e.g.
id = 42
starts.id = 42
terminates.pid = 42
gets reused.We should be able to properly deal with it somehow.
See TODO[#14]
in the code.
Add support for macOS!
See the code near this line:
So, we know the executable of some app and want to get the corresponding AppInfo
from GLib.
Currently, to do that, we enumerate all the available AppInfo
objects and just pick the first one with the corresponding Executable
field.
Maybe we could improve this? How is it supposed to really work? Can a single executable have several AppInfo
entries?
Add support for Linux!
Currently, we rely on a plain list ObservableCollection<ProcessModel> Processes
model.
This is problematic in some ways.
Currently, I am thinking about declaring some sort of observable dictionary (is there such a class in BCL? if not, we could create our own).
Make sure to review and eliminate every instance of TODO[#5]
in the application code.
See the code near this line:
Currently, it's impossible to write tests for this function's behavior. We should update the code to make it testable.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.