RFR: 7033: Allow overriding the id (name) of the event type

Marcus Hirt hirt at openjdk.java.net
Thu Dec 3 10:25:05 UTC 2020


On Mon, 30 Nov 2020 19:51:23 GMT, Gunnar Morling <github.com+28612+gunnarmorling at openjdk.org> wrote:

> @thegreystone et al., this PR proposes two changes to the names of generated event types and their fields:
> 
> * An explicit event type name is derived from the name given in the configuration, instead of using the class name; this is nicer to work with e.g. when enabling/disabling event types for recordings
> * the "field" prefix is removed from event type field names; when examining e.g. `RecordedEvent` instances, names are nicer to look at that way IMO
> 
> Could you log an issue for this change if you agree it's desirable? Thanks! I ran into these issues while using JMC Agent for [tracking SQL statements](https://twitter.com/gunnarmorling/status/1333152245463064579); note the odd "fieldSQLQuery" name marked on the left; the event type name is already adjusted in this screenshot as per this PR here.

I was always a bit hesitant to changing to using "name" for the annotation for the event type IDs, and for an XML grammar it makes sense to have the ID be an attribute (IMHO). "Name" is not required metadata, and it will simply use the class name as event name if not specified (IIRC). Perhaps we should add tests and ensure that this is indeed the default behaviour if not defining id?

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

PR: https://git.openjdk.java.net/jmc/pull/170


More information about the jmc-dev mailing list