Skip to content

8391957: [CRaC] Record restore-related metrics - #349

Open
rvansa wants to merge 3 commits into
openjdk:cracfrom
rvansa:8391957_restore_metrics
Open

rvansa wants to merge 3 commits into
openjdk:cracfrom
rvansa:8391957_restore_metrics

Conversation

@rvansa

@rvansa rvansa commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

We are reporting metrics that describe JVM+application state & performance, the warmed-up-ness. The concept of metrics can be useful for engine extensions and management at different moments, though - therefore we can report restore times (native & Java) and current generation as metrics, and configure image constraints sooner than when we are attempting a restore.



Progress

  • Change must not contain extraneous whitespace

Issue

  • JDK-8391957: [CRaC] Record restore-related metrics (Task - P4)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/crac.git pull/349/head:pull/349
$ git checkout pull/349

Update a local copy of the PR:
$ git checkout pull/349
$ git pull https://git.openjdk.org/crac.git pull/349/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 349

View PR using the GUI difftool:
$ git pr show -t 349

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/crac/pull/349.diff

Using Webrev

Link to Webrev Comment

if (nanos == -1) {
return -1;
}
return Management::ticks_to_ms(ticks);

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Note: ticks equal to nanos on Linux, but Windows could use different granularity.

@bridgekeeper

bridgekeeper Bot commented Sep 8, 2026

Copy link
Copy Markdown

👋 Welcome back rvansa! A progress list of the required criteria for merging this PR into crac will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk

openjdk Bot commented Sep 8, 2026

Copy link
Copy Markdown

@rvansa This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8391957: [CRaC] Record restore-related metrics

You can use pull request commands such as /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 2 new commits pushed to the crac branch:

  • df66721: 8391953: [CRaC] crlib_bitmap_comparison_t enum values have no unique prefix
  • 9bd5f77: 8391859: [CRaC] Test repeated checkpoint

Please see this link for an up-to-date comparison between the source branch of this pull request and the crac branch.
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the crac branch, type /integrate in a new comment.

@openjdk openjdk Bot added ready Pull request is ready to be integrated rfr Pull request is ready for review labels Sep 8, 2026
@mlbridge

mlbridge Bot commented Sep 8, 2026

Copy link
Copy Markdown

Webrevs

Comment on lines +863 to +866
scores.append({"vm.uptimeSinceRestore", static_cast<double>(_generation > 1 ? crac::uptime_since_restore() / NANOSECS_PER_MILLISEC : -1)});

scores.append({"vm.crac.generation", static_cast<double>(_generation)});
scores.append({"vm.restore.nativeTime", static_cast<double>(_generation > 1 ? (_restore_native_end_nanos - _restore_start_nanos) / NANOSECS_PER_MILLISEC : -1)});

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Are the -1 fallbacks (and initializing _restore_native_end_nanos = -1 at the top of the file) really needed when we guard the reads with _generation > 1?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The initialization isn't necessary, this is the only read. But about the fallback - do you suggest to include the metric only if _generation > 1? I have followed the same pattern as with vm.uptimeSinceRestore above, rather than omitting this entirely.

Btw., with keep-running this value is set even if this is a booted (not restored) instance. In that case it's a bit confusing (has some low value) but I don't think it's critical.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready Pull request is ready to be integrated rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

2 participants