Comments (6)
Initial framework for warnings added to the console
crate in #113 and #123. Right now, we can associate warnings with tasks and display them!
However, we only have a single warning that we detect: self-wake percentages over 50%. We should now be able to start designing and implementing additional warnings.
from console.
Yeah, this is a great idea. It would be nice to have some fairly modular way of defining warnings, similar to clippy --- obviously the actual detection of warning conditions is generally complex enough that adding a warning will generally require a non-trivial amount of code, but it would be cool to be able to have stuff like toggling on and off specific warnings etc be taken care of out of the box when adding new ones.
For starters though we should probably just write some purely by hand to figure out what they end up looking like...
from console.
So I originally assumed that lints/warnings would be entirely in the console (nothing in the subscriber). The reasons were:
- I didn't want to do too much computing in-process of the monitored application, so having that run in the console seemed better.
- It seemed like one might want to modify some lint configuration when attaching a console (or web view or whatever). Maybe when you first connect, you realize the poll-time-max warning is too aggressive, so you want to restart the console with a higher maximum.
However, I'm now leaning the other way, that it should happen in the subscriber, and the warnings should just be emitted in protobuf and simply shown in the console. This fits more with the console only showing info, not processing and inventing new info. It also means that the code to determine if tasks are triggering warnings doesn't need to be duplicated in different viewing application (like a web view).
from console.
Now I'm starting to lean back the other way, that the warnings code should be entirely in the console
, and not in the subscriber. That'd reduce the amount of work the instrumentation library is causing to the user's process. It also happens to be simpler to to do, since we don't need code in both the subscriber and console to handle them, and a new way to send them over the connection.
from console.
FWIW, I'm personally strongly in favor of doing this work in the UI application. Eventually, if we want to have multiple UIs, I expect we would factor out the core data model part of the console
TUI into a crate that could be a dependency of the console TUI, a GUI app, web UI, etc. The code for detecting and generating warnings could be in that crate so that it doesn't have to be reimplemented.
from console.
Some additional things that would be nice to add:
- some kind of short identifier for warnings (either a short string name like
"poll_time_percent"
and/or a number like[W0001]
) - users can turn on or off a list of warnings with a CLI arg (using short identifiers)
- some warnings (like the self-wake percent warning) could have configurable thresholds (the percentage of self-wakes). we could consider providing a way to configure this as well...
from console.
Related Issues (20)
- Don't send task names as strings HOT 3
- Flaky `console-subscriber` integration tests HOT 2
- Sorting does not work on all columns in the resources view HOT 2
- `tokio-console` won't quit when the main program has exit HOT 1
- Improve attributes sorting in the resources tab
- subscriber: add grpc-web support to console-subscriber HOT 4
- a global default trace dispatcher has already been set HOT 8
- RUSTSEC-2021-0145: Potential unaligned read
- Console doesn't detect self wakes from `tokio::task::yield_now()` after Tokio 1.23 HOT 5
- Key presses happen twice on Windows HOT 4
- `blocking` and `block_on` tasks have false positive lints HOT 1
- Autodetection of new execution not always working
- Make better use of space in task detail screen HOT 1
- Format "last woken" time prettily HOT 4
- tokio::task::spawn_blocking() tasks show as 'warning: task has never yielded' HOT 2
- Analyze log files and log playback HOT 1
- tokio-console cannot handle window path correctly
- tokio-console cannot show the pause status correctly HOT 5
- assertion failed: meta.is_event() HOT 3
- The application panicked (crashed) when trying to `ENTER` on a resource HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from console.