RFR: 8337501: JFR: Use TimespanUnit
Could I have a review of change that updates the JFR code to use the newly introduced TimespanUnit enum. The enum is updated to use j.u.c.TimeUnit enum so the method TimeUnit::toNanos can be leveraged. It can handle over- and underflow properly. Path forward is to introduce a Timespan class, similar to the Rate class, that will prevent negative values, parse "infinity" and provide means to compare values. This will consolidate code further. Testing: test/jdk/jdk/jfr Thanks Erik ------------- Commit messages: - Move initialization in constructor - Initial Changes: https://git.openjdk.org/jdk/pull/20392/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=20392&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8337501 Stats: 57 lines in 4 files changed: 10 ins; 22 del; 25 mod Patch: https://git.openjdk.org/jdk/pull/20392.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/20392/head:pull/20392 PR: https://git.openjdk.org/jdk/pull/20392
On Tue, 30 Jul 2024 17:27:51 GMT, Erik Gahlin <egahlin@openjdk.org> wrote:
Could I have a review of change that updates the JFR code to use the newly introduced TimespanUnit enum. The enum is updated to use j.u.c.TimeUnit enum so the method TimeUnit::toNanos can be leveraged. It can handle over- and underflow properly.
Path forward is to introduce a Timespan class, similar to the Rate class, that will prevent negative values, parse "infinity" and provide means to compare values. This will consolidate code further.
Testing: test/jdk/jdk/jfr
Thanks Erik
Marked as reviewed by mgronlun (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/20392#pullrequestreview-2210704676
On Tue, 30 Jul 2024 17:27:51 GMT, Erik Gahlin <egahlin@openjdk.org> wrote:
Could I have a review of change that updates the JFR code to use the newly introduced TimespanUnit enum. The enum is updated to use j.u.c.TimeUnit enum so the method TimeUnit::toNanos can be leveraged. It can handle over- and underflow properly.
Path forward is to introduce a Timespan class, similar to the Rate class, that will prevent negative values, parse "infinity" and provide means to compare values. This will consolidate code further.
Testing: test/jdk/jdk/jfr
Thanks Erik
This pull request has now been integrated. Changeset: a45bb55d Author: Erik Gahlin <egahlin@openjdk.org> URL: https://git.openjdk.org/jdk/commit/a45bb55ddb6abfa520a2e4d7a5cd4d638a526efd Stats: 57 lines in 4 files changed: 10 ins; 22 del; 25 mod 8337501: JFR: Use TimespanUnit Reviewed-by: mgronlun ------------- PR: https://git.openjdk.org/jdk/pull/20392
participants (2)
-
Erik Gahlin
-
Markus Grönlund