RFR: 8296: No Java process should ever be PID 1

Marcus Hirt hirt at openjdk.org
Fri Dec 6 15:03:19 UTC 2024


On Wed, 4 Dec 2024 18:38:39 GMT, Henrik Dafgård <hdafgard at openjdk.org> wrote:

>> Hi Hendrik!
>> 
>> Great progress on the rule! Configuration attributes should be empty, since the rule is not configurable. For the result, you should at least return the score attribute (we'll make the API nicer for JMC 10), and even though we know the PID is one when the rule is triggering, perhaps we should add the PID attribute to the results as well. So, following the pattern of other rules, perhaps add:
>> 
>> 	private static final Collection<TypedResult<?>> RESULT_ATTRIBUTES = Arrays
>> 			.<TypedResult<?>> asList(TypedResult.SCORE, PID);
>
> I think this is fine actually, if we don't expect the output to ever be dynamic then this I don't see the need to add a result attribute.

Can we think of situations where we would ever want to use the pid in the result? For example highlighting the process in the processes list with the result (good or bad) etc?

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

PR Review Comment: https://git.openjdk.org/jmc/pull/613#discussion_r1871435279


More information about the jmc-dev mailing list