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

Added debugger display information to TestScheduler and HistoricalScheduler #809

Merged
merged 1 commit into from
Sep 17, 2018

Conversation

paulomorgado
Copy link

This is very helpful when debugging tests.

@danielcweber
Copy link
Collaborator

danielcweber commented Sep 13, 2018

@paulomorgado Nice idea. I wonder whether we want to have this for even more classes, e.g. all the observable implementations. I'm thinking outputting a readable representation of an operator chain. Then again, it might slow down the debugger big time...what do you think?

@paulomorgado
Copy link
Author

It might, but only when evaluated.

But, for that use case, a debug visualizer might be a better match.

What do you think, @raffaeler?

@apobekiaris
Copy link

@paulomorgado Nice idea. I wonder whether we want to have this for even more classes, e.g. all the observable implementations. I'm thinking outputting a readable representation of an operator chain. Then again, it might slow down the debugger big time...what do you think?

It may be great for some cases however at least in my projects I my experience is a really bad Vs behaviour when property evaluation is on. Consider making a switch off for this as well.

@paulomorgado
Copy link
Author

How would I do this, @apobekiaris?

@apobekiaris
Copy link

How would I do this, @apobekiaris?

Sorry no clue it just looked something that may affect me.

@raffaeler
Copy link

@paulomorgado nice work and great idea indeed.
Another approach is to add an additional field inside the class that is compiled only in the debug fields thanks to the preprocessor definitions. This field could store the timings and would work even without the debugger being attached, allowing for example to trace the timings on your logger/tracer of choice.
With regards to the debugger visualizer, it is definitely feasible but it also depends what you really want to see. It is really a 'visualizer' approach which is used to make the object representation more readable as I did for the Expression Tree which I reverse to the C# representing that tree.

@paulomorgado
Copy link
Author

ETW-like tracing would be nice, but that's another thing.

If I recall it correctly, debug visualizations are part of the type/object and debug vizualizers can be an add-on used only by the IDE and that it's not deployed with the library (like analyzers).

@paulomorgado
Copy link
Author

Nevertheless, if anyone has suggestions for other types that would be nice to add debug vizualizers, I can add them.

@danielcweber
Copy link
Collaborator

danielcweber commented Sep 13, 2018

@paulomorgado There's actually great potential in this approach I think. As you might know, we would like to optimize some code away but can't because RxSpy, an inspection tool for Rx, depends on certain internals. RxSpy is not in active development and it's unclear to me how widespread its use is. A great deal of its functionality could maybe be replaced by visualizers...maybe....I'm just being visonary here.

@raffaeler
Copy link

@paulomorgado I did not mean to replace ETW tracing.
You are right about debugger visualizers. They are just a way for the debugger to "view" in an user-friendly way the state of an object.

@paulomorgado
Copy link
Author

@raffaeler, I said ETW-like because .NET Core on non-Windows system doesn't exactly use ETW. Does it?

@raffaeler
Copy link

@paulomorgado The abstraction provided in aspnet core is the same for Windows and Linux. On Windows ETW is used. On Linux the abstraction uses LTTNG which is the 'official' way to trace.
The biggest difference is that ETW provides real-time tracing, while on Linux a file is created that you can analyze later either on Linux or on Windows.

@danielcweber
Copy link
Collaborator

@paulomorgado We have failing approval tests due to the added attributes on some types. Could you please fix them? I'll merge this PR then, more work on a smoother debugging experience is greatly appreciated!

@paulomorgado
Copy link
Author

paulomorgado commented Sep 17, 2018

Done, @danielcweber!

@danielcweber danielcweber merged commit 65be066 into dotnet:master Sep 17, 2018
@paulomorgado paulomorgado deleted the scheduler-debugger-display branch September 17, 2018 14:34
@danielcweber danielcweber mentioned this pull request Oct 1, 2018
danielcweber added a commit that referenced this pull request Oct 1, 2018
Prepare bugfix release 4.1.1. Contains #806, #807, #809, #816.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants