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

Implement metric for app start time #5213

Closed
wants to merge 2 commits into from
Closed

Conversation

briantting
Copy link
Contributor

@briantting briantting commented Mar 27, 2025

Implements the plumbing for app start time metric but calls base::SysInfo::AppStartupTime() as a dummy placeholder whose value can be retrieved through devtools by calling
performance.GetAppStartupTime().

b/389132127

@briantting briantting force-pushed the time branch 2 times, most recently from 8906f66 to 75013d6 Compare March 27, 2025 02:25
@@ -2,6 +2,9 @@
[
ImplementedAs=PerformanceExtensions
] partial interface Performance {
// Returns the application startup duration (us) in bytes, according to
// base::SysInfo::AppStartupTime().
[CallWith=ScriptState] unsigned long long getAppStartupTime();
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

@andrewsavage1 andrewsavage1 Mar 27, 2025

Choose a reason for hiding this comment

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

I think we can do async here, but let me check with Sergei

Edit: regardless, changing it between async and sync is easy, so no need to pause on implementing the rest of this PR and saving this decision for the end

Copy link
Contributor

Choose a reason for hiding this comment

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

Talked to Sergei and Niketh and they're fine with it being async so we should make it async. @briantting lmk if you need me to walk you through how to do that, but there are a number of h5vcc examples already for you to reference for the implementation

@hlwarriner
Copy link
Contributor

@briantting I noticed this is still in draft mode so haven't yet left feedback - but please lmk if I should go ahead and review.

@briantting briantting force-pushed the time branch 4 times, most recently from a18a06d to e5abdda Compare April 1, 2025 00:56
Implements the plumbing for app startup time metric and calls
base::SysInfo::AppStartupTime() whose value can be retrieved
devtools by calling performance.GetAppStartupTime().

b/389132127
@briantting briantting marked this pull request as ready for review April 1, 2025 02:22
@briantting briantting requested a review from a team as a code owner April 1, 2025 02:22
@briantting briantting enabled auto-merge April 1, 2025 02:22

using starboard::android::shared::StarboardBridge;
#elif BUILDFLAG(IS_COBALT)
#include "cobalt/cobalt.h"
Copy link
Member

Choose a reason for hiding this comment

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

This breaks layering in a little awkward way. Cobalt is expected to depend on //base, but //base isn't expected to depend on Cobalt.

//base depending on //starboard is okay though.

There's maybe two ways to avoid this :

  • Capture the timestamp for the non-android case also somewhere in Starboard code

  • Or invert the dependency here and add a SysInfo::SetAppStartTimestamp() that can be called from Cobalt

As a stopgap, this here isn't very bad either though, as we are breaking layering in a few other places. @andrewsavage1 wdyt ?

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'm trying to invert the dependency with the follow up commit in this PR, but having some difficulties.

@briantting
Copy link
Contributor Author

it's a wip and running into linking problems

@briantting briantting marked this pull request as draft April 1, 2025 06:06
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.

5 participants