Skip to content

Add System.Diagnostics.TextMapPropagator support #33777

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

Merged
merged 10 commits into from
Jul 15, 2021
Merged

Conversation

shirhatti
Copy link
Contributor

No description provided.

@ghost ghost added the area-runtime label Jun 22, 2021
@shirhatti shirhatti requested a review from tarekgh June 22, 2021 23:46
@shirhatti

This comment has been minimized.

@shirhatti shirhatti added the community-contribution Indicates that the PR has been added by a community member label Jun 25, 2021
@shirhatti
Copy link
Contributor Author

shirhatti commented Jun 28, 2021

Plaintext on aspnet-citrine-lin

application old new
CPU Usage (%) 99 99 0.00%
Cores usage (%) 2,781 2,778 -0.11%
Working Set (MB) 415 415 0.00%
Private Memory (MB) 1,006 1,557 +54.77%
Build Time (ms) 3,553 5,432 +52.88%
Start Time (ms) 150 171 +14.00%
Published Size (KB) 106,173 106,173 0.00%
.NET Core SDK Version 6.0.100-preview.6.21276.12 6.0.100-preview.6.21276.12
Max CPU Usage (%) 181 99 -45.30%
Max Working Set (MB) 434 435 +0.23%
Max GC Heap Size (MB) 317 302 -4.73%
Size of committed memory by the GC (MB) 363 362 -0.28%
Max Number of Gen 0 GCs / sec 7.00 7.00 0.00%
Max Number of Gen 1 GCs / sec 1.00 1.00 0.00%
Max Number of Gen 2 GCs / sec 1.00 1.00 0.00%
Max Time in GC (%) 1.00 0.00
Max Gen 0 Size (B) 672 672 0.00%
Max Gen 1 Size (B) 4,125,536 1,060,016 -74.31%
Max Gen 2 Size (B) 3,181,976 3,221,496 +1.24%
Max LOH Size (B) 230,160 672 -99.71%
Max Allocation Rate (B/sec) 2,040,420,720 2,040,749,408 +0.02%
Max GC Heap Fragmentation 1 1 -9.88%
# of Assemblies Loaded 94 93 -1.06%
Max Exceptions (#/s) 697 687 -1.43%
Max Lock Contention (#/s) 263 361 +37.26%
Max ThreadPool Threads Count 48 48 0.00%
Max ThreadPool Queue Length 207 185 -10.63%
Max ThreadPool Items (#/s) 176,635 186,574 +5.63%
Max Active Timers 0 0
IL Jitted (B) 172,641 183,274 +6.16%
Methods Jitted 1,859 2,072 +11.46%
load old new
CPU Usage (%) 19 19 0.00%
Cores usage (%) 531 531 0.00%
Working Set (MB) 37 37 0.00%
Private Memory (MB) 358 358 0.00%
Start Time (ms) 0 0
First Request (ms) 70 72 +2.86%
Requests/sec 2,476,644 2,475,423 -0.05%
Requests 37,394,952 37,378,301 -0.04%
Mean latency (ms) 1.15 1.15 0.00%
Max latency (ms) 49.90 53.67 +7.56%
Bad responses 0 0
Socket errors 0 0
Read throughput (MB/s) 311.77 311.62 -0.05%
Latency 50th (ms) 0.99 0.96 -3.03%
Latency 75th (ms) 1.46 1.41 -3.42%
Latency 90th (ms) 2.07 1.91 -7.73%
Latency 99th (ms) 0.00 0.00

@shirhatti shirhatti requested a review from Tratcher June 28, 2021 19:39
@shirhatti
Copy link
Contributor Author

@Tratcher The only new change I've made since we last spoke is to resolve the Propagator from DI instead of using the global static. Can you review that?

Also, the difference in the GC counters makes no sense to me 🤷. Can you help me make sense of that?

Copy link
Member

@Tratcher Tratcher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The DI change seems fine

@Tratcher
Copy link
Member

No idea on the GC data, but at least it's getting better and not worse 😁.

@shirhatti
Copy link
Contributor Author

There's no way LOH is 672 bytes. Kestrel's slabbed memory pool is allocated in the LOH. @sebastienros any ideas? Repeating the run, I got 131800 for Max LOH size for both before/after.

As for reduction in Max Gen 1 and increase in Max Gen 2 size, I'm not sure what to make of it? Something is getting promoted sooner? I'll try collecting an allocation profile to make more sense of this

@shirhatti shirhatti linked an issue Jul 14, 2021 that may be closed by this pull request
@shirhatti shirhatti force-pushed the shirhatti/propagator branch from d476798 to abcc758 Compare July 14, 2021 19:43
@shirhatti shirhatti marked this pull request as ready for review July 14, 2021 19:48
@shirhatti shirhatti requested a review from noahfalk July 14, 2021 19:49
@tarekgh
Copy link
Member

tarekgh commented Jul 14, 2021

    private static HostingApplication CreateApplication(IHttpContextFactory httpContextFactory = null, bool useHttpContextAccessor = false,

May be a clever idea in a future PR to add a test consuming other propagator. e.g., tests create a custom propagator and consume it. You don't have to block this PR on that.


Refers to: src/Hosting/Hosting/test/HostingApplicationTests.cs:182 in abcc758. [](commit_id = abcc758, deletion_comment = False)

Copy link
Member

@tarekgh tarekgh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some commented. LGTM otherwise.

// AddBaggage adds items at the beginning of the list, so we need to add them in reverse to keep the same order as the client
// An order could be important if baggage has two items with the same key (that is allowed by the contract)
for (var i = baggage.Length - 1; i >= 0; i--)
// Order could be important if baggage has two items with the same key (that is allowed by the contract)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You used to add these in reverse, does ExtractBaggage handle the reversal? If so then include that in the comment. Otherwise this comment about order sensitivity doesn't make sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’ll send a follow-up PR to fix the comment. I want to merge this when the PR checks are green in case AzDo has a bad day again

@shirhatti shirhatti merged commit e6afd50 into main Jul 15, 2021
@shirhatti shirhatti deleted the shirhatti/propagator branch July 15, 2021 02:21
@ghost ghost added this to the 6.0-preview7 milestone Jul 15, 2021
@davidfowl
Copy link
Member

I'm assuming there's no extra allocations here.

shirhatti added a commit that referenced this pull request Jul 20, 2021
shirhatti added a commit that referenced this pull request Jul 21, 2021
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Aug 24, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions community-contribution Indicates that the PR has been added by a community member
Projects
None yet
6 participants