RFR: 8342818: Implement CPU Time Profiling for JFR

Erik Gahlin egahlin at openjdk.org
Tue Oct 29 13:31:18 UTC 2024


On Wed, 28 Aug 2024 16:47:21 GMT, Johannes Bechberger <jbechberger at openjdk.org> wrote:

> This is the code for the [JEP draft: CPU Time based profiling for JFR].

src/jdk.jfr/share/classes/jdk/jfr/internal/util/TimespanRate.java line 41:

> 39:         boolean isPeriod = !text.contains("/");
> 40:         if (isPeriod) {
> 41:             var period = ValueParser.parseTimespanWithInfinity(text);

I think it would be good if the TimespanRate::of(String) method returns null if the value is not valid and let the CPUThrottleSetting deal with interpretation of an unparsable value.


var period = ValueParser.parseTimespanWithInfinity(text, Long.MAX_VALUE);
if (period == Long.MAX_VALUE) {
  return null;
}

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/20752#discussion_r1820800993


More information about the hotspot-dev mailing list