Skip to content

Conversation

@niranjanyardi
Copy link
Contributor

No description provided.

@github-actions
Copy link

🤖 Gemini Suggested Commit Message


cobalt: Expose application startup time for Starboard

Introduce a mechanism to record the Cobalt application startup timestamp,
specifically the kSbEventTypeStart event, for Starboard platforms.
This change enables GetAppStartupTime to return the recorded timestamp
rather than being NOTIMPLEMENTED, providing crucial performance metrics
for 3rd-party platforms. The time reported to JavaScript is relative to
the page's time origin.

Bug: b/389132127

💡 Pro Tips for a Better Commit Message:

  1. Influence the Result: Want to change the output? You can write custom prompts or instructions directly in the Pull Request description. The model uses that text to generate the message.
  2. Re-run the Generator: Post a comment with: /generate-commit-message

int64_t time_origin = performance_obj.GetTimeOriginInternal().ToInternalValue();
LOG(INFO) << "OriginTime is "<< time_origin;
LOG(INFO) << "startup_time variable value is "<< startup_time;
double startup_time_ms = static_cast<double>(startup_time - time_origin) / 1000.0;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

let's discuss in tomnorow's meeting @andrewsavage1

want to double check with you if this looks okay or you had something else in mind

} // namespace

void SetStartupTime(int64_t startup_time) {
g_startup_time = startup_time;
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't you need a mutex guarding access to this?

BindRemotePerformance(script_state)->GetAppStartupTime(&startup_time);
ScriptPromise promise = resolver->Promise();
#if BUILDFLAG(IS_STARBOARD)
int64_t time_origin = performance_obj.GetTimeOriginInternal().ToInternalValue();
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of converting this to an int64_t, which is not an intuitive type, let's convert startup_time to a base::Time to make the math we're doing more clear.

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.

2 participants