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

Fix AppInitialized latency metric #15206

Merged

Conversation

lhecker
Copy link
Member

@lhecker lhecker commented Apr 19, 2023

The AppInitialized latency metric logs how long the application needs
to initialize the UI. 5b434dc broke this metric, because it was now
executing the code outside of the Initialized callback.
It's the difference between a "latency" of ~50ms and ~350ms.

As an added bonus it moves the _ApplyStartupTaskStateChange task
into the Initialized callback as well, because why not.

Validation Steps Performed

  • Breakpoint into "AppInitialized" - latency is now correct ✅

@lhecker lhecker added Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal. Priority-3 A description (P3) Automerge-Not-Compatible labels Apr 19, 2023
@lhecker lhecker added this to the Terminal v1.18 milestone Apr 19, 2023
@lhecker lhecker force-pushed the dev/lhecker/fix-app-initialized-metric branch from 68a5778 to 09d7cdd Compare April 19, 2023 13:09
@@ -264,6 +263,8 @@ namespace winrt::TerminalApp::implementation
{
_root->SetFullscreen(true);
}

AppLogic::Current()->NotifyRootInitialized();
Copy link
Member Author

Choose a reason for hiding this comment

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

@zadjii-msft Is this the right way to get a handle to AppLogic? BTW given that App::Logic() returns a singleton, should we maybe remove static AppLogic logic; from there and move it into AppLogic::Current()? If there's a singleton, I feel like it's more idiomatic to create it inside the class of the singleton.

Copy link
Member

Choose a reason for hiding this comment

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

That's what I'd do yea

@DHowett DHowett force-pushed the dev/lhecker/fix-app-initialized-metric branch from 09d7cdd to 413963d Compare April 19, 2023 18:20
@DHowett DHowett force-pushed the dev/lhecker/startup-animations branch from 649f89b to 082aef0 Compare April 19, 2023 18:20
@DHowett DHowett force-pushed the dev/lhecker/fix-app-initialized-metric branch from 413963d to c599c02 Compare April 19, 2023 19:32
Base automatically changed from dev/lhecker/startup-animations to main April 20, 2023 12:31
@zadjii-msft zadjii-msft self-assigned this Apr 20, 2023
@DHowett DHowett force-pushed the dev/lhecker/fix-app-initialized-metric branch from c599c02 to a248d8b Compare April 20, 2023 19:02
Copy link
Member

@carlos-zamora carlos-zamora left a comment

Choose a reason for hiding this comment

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

LGTM

@zadjii-msft zadjii-msft added the AutoMerge Marked for automatic merge by the bot when requirements are met label Apr 25, 2023
@carlos-zamora carlos-zamora assigned lhecker and unassigned zadjii-msft Apr 25, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot enabled auto-merge (squash) April 25, 2023 20:24
@carlos-zamora
Copy link
Member

@lhecker FYI looks like you have a little merge conflict you've gotta fix before merging this

@microsoft-github-policy-service microsoft-github-policy-service bot deleted the dev/lhecker/fix-app-initialized-metric branch April 25, 2023 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AutoMerge Marked for automatic merge by the bot when requirements are met Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-3 A description (P3) Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants