-
Notifications
You must be signed in to change notification settings - Fork 5.1k
[browser] managed Diagnostics.Metrics and Diagnostics.Tracing single-threaded #113524
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
[browser] managed Diagnostics.Metrics and Diagnostics.Tracing single-threaded #113524
Conversation
- split AggregationManager.Threads.cs and AggregationManager.Wasm.cs - make it timer based for WASM - split CounterGroup.Threads.cs and CounterGroup.Wasm.cs - make it timer based for WASM - split EventPipeEventDispatcher.Threads.cs and EventPipeEventDispatcher.Wasm.cs - make it Task based - add switch System.Net.Http.EnableMetrics and use it in HTTP client to make MetricsHandler optional - Api - remove UnsupportedOSPlatform("browser")] on diagnostic API Tests - enable WasmPerfTracing, EventSourceSupport, MetricsSupport for unit tests which need it - fix ActiveIssue dotnet#93754 - enable TestSubscriptionManagerDisposal - fix nullable argument in BeginInstrumentReporting, EndInstrumentReporting and InstrumentPublished - enable MetricEventSourceTests, RuntimeMetricsTests, ActivityTracking
Note regarding the
|
1 similar comment
Note regarding the
|
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/SocketsHttpHandler.cs
Outdated
Show resolved
Hide resolved
/azp run runtime-libraries-coreclr outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
I am seeing this timeout https://helixr1107v0xdcypoyl9e7f.blob.core.windows.net/dotnet-runtime-refs-pull-113524-merge-1db6ed0772b4439aae/System.Diagnostics.DiagnosticSource.Tests/1/console.6866e220.log?helixlogtype=result, looks these failing in slow platforms (like Debug and Linux Musl). These outer loop tests take a long time so on slow platforms can timeout I guess. I don't recall seeing such failures, but I can see why it can time out. I have re-run the failing tests hopefully it passes. If it is still failing, you may ignore them for now as it is time out and passing in other platforms. |
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.
👍
# Conflicts: # src/libraries/Microsoft.Extensions.Diagnostics/tests/Microsoft.Extensions.Diagnostics.Tests.csproj
/ba-g CI issues are known |
This change enables Diagnostics.Metrics and Diagnostics.Tracing in single-threaded browser.
The behavior is slightly different from desktop/server dotnet because the events are only propagated on the same thread as application logic. That's when the user code yields to the browser event loop. In well behaved applications, this is often, because that's how you allow the browser to re-render the page. If the user code is running long synchronous loop, the events would be only delivered later.
Implementation
CounterGroup
andRuntimeEventSource
from browser buildEventPipeEventDispatcher.Threads.cs
andEventPipeEventDispatcher.Wasm.cs
- make it Task basedAggregationManager
- make it timer based for WASMOther
BeginInstrumentReporting
,EndInstrumentReporting
andInstrumentPublished
Tests
EventSourceSupport
,MetricsSupport
MSBuild props for unit tests which need itWasmPerfTracing
forActivityTracking
test to work, becauseEventPipeEventProvider.EventActivityIdControl
is inlibmono-component-diagnostics_tracing
which need to be linked inTestSubscriptionManagerDisposal
RuntimeMetricsTests
,ActivityTracking
MetricEventSourceTests
areOuterLoop
, but I made them work locally by rewriting them to async.Fixes #93754
Contributes to #76316