Package com.jprofiler.api.probe.embedded
Class PayloadProbe
java.lang.Object
com.jprofiler.api.probe.embedded.PayloadProbe
For each payload probe, you have to create a subtype of this class and pass it as a class literal
to the methods in
Payload
.
You can override the methods of this class to configure your probe. The only method you have to implement is
getName()
.
You can add additional custom telemetries by adding public static methods to your subclass that return a number type and are annotated with Telemetry
.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetControlObjectName
(Object controlObject) If you use control objects and a previously unknown control object is passed toPayload.enter(Class, Object, Enum)
,Payload.execute(Class, String, Object, Enum, Runnable)
orPayload.execute(Class, String, Object, Enum, Callable)
, the JProfiler agent will call this method to associate a name with the control object.You can specify custom types for events.You can override this method to add a description to your probe in the JProfiler UI.abstract String
getName()
Implement this method to specify the display name of your probe In the JProfiler UI, this string is used for the view name in the view selector below the "JEE & probes" section.boolean
If your probe supports control objects, you have to override this method and returntrue
.boolean
You can override this method and returnfalse
if you want to remove the default telemetries.boolean
isEvents()
You can override this method and returnfalse
if you want to remove the events view.
-
Constructor Details
-
PayloadProbe
public PayloadProbe()
-
-
Method Details
-
getName
Implement this method to specify the display name of your probe In the JProfiler UI, this string is used for the view name in the view selector below the "JEE & probes" section.- Returns:
- the name of your probe
-
getDescription
You can override this method to add a description to your probe in the JProfiler UI. It is shown in the probe view below the probe name.- Returns:
- your optional description
-
isEvents
public boolean isEvents()You can override this method and returnfalse
if you want to remove the events view.- Returns:
- if the events view should be displayed
-
isDefaultTelemetries
public boolean isDefaultTelemetries()You can override this method and returnfalse
if you want to remove the default telemetries. The default telemetries are the event frequency and the average duration telemetries as well as the open control object telemetries ifisControlObjects()
returnstrue
.- Returns:
- if the default telemetries will be recorded
-
isControlObjects
public boolean isControlObjects()If your probe supports control objects, you have to override this method and returntrue
.- Returns:
- if control objects can be recorded
-
getCustomTypes
You can specify custom types for events. If control objects are recorded, the same types are used for the associated control object states. In the overridden method, return anEnum
class with all your states as constants. ThetoString()
method is used for the event display name. You can further customize your events by implementingTypeCustomizer
in the enum class.- Returns:
- the class of your event enum
-
getControlObjectName
If you use control objects and a previously unknown control object is passed toPayload.enter(Class, Object, Enum)
,Payload.execute(Class, String, Object, Enum, Runnable)
orPayload.execute(Class, String, Object, Enum, Callable)
, the JProfiler agent will call this method to associate a name with the control object. You can alternatively associate a name with a control object by callingPayload.openControlObject(Class, Object, String)
.- Parameters:
controlObject
- the control object that has no name associated yet- Returns:
- a name that will be displayed in the JProfiler UI for this object
-