Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8284977: MetricsTesterCgroupV2.getLongValueEntryFromFile fails when n…
…amed value doesn't exist

Reviewed-by: sgehwolf, mdoerr
  • Loading branch information
MBaesken committed Jun 15, 2022
1 parent 08400f1 commit 444a0d9
Showing 1 changed file with 5 additions and 0 deletions.
Expand Up @@ -121,6 +121,11 @@ private long getLongValueEntryFromFile(String file, String metric) {
Path filePath = Paths.get(UNIFIED.getPath(), file);
try {
String strVal = Files.lines(filePath).filter(l -> l.startsWith(metric)).collect(Collectors.joining());
if (strVal.isEmpty()) {
// sometimes the match for the metric does not exist, e.g. cpu.stat's nr_periods iff the controller
// is not enabled
return UNLIMITED;
}
String[] keyValues = strVal.split("\\s+");
String value = keyValues[1];
return convertStringToLong(value);
Expand Down

7 comments on commit 444a0d9

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

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

@MBaesken
Copy link
Member Author

Choose a reason for hiding this comment

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

/backport jdk17u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 444a0d9 Jul 6, 2022

Choose a reason for hiding this comment

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

@MBaesken the backport was successfully created on the branch MBaesken-backport-444a0d98 in my personal fork of openjdk/jdk17u-dev. To create a pull request with this backport targeting openjdk/jdk17u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 444a0d98 from the openjdk/jdk repository.

The commit being backported was authored by Matthias Baesken on 15 Jun 2022 and was reviewed by Severin Gehwolf and Martin Doerr.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk17u-dev:

$ git fetch https://github.com/openjdk-bots/jdk17u-dev MBaesken-backport-444a0d98:MBaesken-backport-444a0d98
$ git checkout MBaesken-backport-444a0d98
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk17u-dev MBaesken-backport-444a0d98

@RealCLanger
Copy link
Contributor

Choose a reason for hiding this comment

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

/backport jdk19u

@openjdk
Copy link

@openjdk openjdk bot commented on 444a0d9 Aug 24, 2022

Choose a reason for hiding this comment

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

@RealCLanger the backport was successfully created on the branch RealCLanger-backport-444a0d98 in my personal fork of openjdk/jdk19u. To create a pull request with this backport targeting openjdk/jdk19u:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 444a0d98 from the openjdk/jdk repository.

The commit being backported was authored by Matthias Baesken on 15 Jun 2022 and was reviewed by Severin Gehwolf and Martin Doerr.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk19u:

$ git fetch https://github.com/openjdk-bots/jdk19u RealCLanger-backport-444a0d98:RealCLanger-backport-444a0d98
$ git checkout RealCLanger-backport-444a0d98
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk19u RealCLanger-backport-444a0d98

@jmtd
Copy link

@jmtd jmtd commented on 444a0d9 Sep 29, 2022

Choose a reason for hiding this comment

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

/backport jdk11u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 444a0d9 Sep 29, 2022

Choose a reason for hiding this comment

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

@jmtd the backport was successfully created on the branch jmtd-backport-444a0d98 in my personal fork of openjdk/jdk11u-dev. To create a pull request with this backport targeting openjdk/jdk11u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 444a0d98 from the openjdk/jdk repository.

The commit being backported was authored by Matthias Baesken on 15 Jun 2022 and was reviewed by Severin Gehwolf and Martin Doerr.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk11u-dev:

$ git fetch https://github.com/openjdk-bots/jdk11u-dev jmtd-backport-444a0d98:jmtd-backport-444a0d98
$ git checkout jmtd-backport-444a0d98
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk11u-dev jmtd-backport-444a0d98

Please sign in to comment.