RFR: 8342818: Implement CPU Time Profiling for JFR
Johannes Bechberger
jbechberger at openjdk.org
Tue Oct 29 11:00:23 UTC 2024
On Sat, 21 Sep 2024 11:37:45 GMT, Erik Gahlin <egahlin at openjdk.org> wrote:
> > > How is throttling handled? We don't want buffers to be filled up with sample events?
> >
> >
> > By setting the internal queue size. The user can throttle by setting the interval, any other option would lead to bias.
>
> Where can the queue size be set and how does a user know what is a reasonable value?
The queue size is pre-computed to a large value that shouldn't lead to many dropped samples. I don't think that making the queue size settable is really useful. Please ignore, therefore, my mentioning of the queue size for throttling; the real throttling is by setting the interval. There is no other way that is also understandable by the user.
>> I can try to implement. I thought it would be easier to comprehend this way.
>
> Since you need custom logic in CPUThrottleSetting, it might be easier to just have two distinct types and skip the common interface?
>
> I haven't looked at it closely, it's just my impression. Maybe there should be a ThrottlePeriod(double period, boolean autoAdapt) with a factory method where it first checks if it can be created from Rate.of(text).
You were right, the code is now far simpler. I dropped the renaming of Rate and created a TimespanRate(double rate, boolean autoadapt).
-------------
PR Comment: https://git.openjdk.org/jdk/pull/20752#issuecomment-2365165291
PR Review Comment: https://git.openjdk.org/jdk/pull/20752#discussion_r1808564743
More information about the hotspot-dev
mailing list