public interface Connection
All requests for new profiling data that has to be queried from the profiling agent are done by calling a method on a connection object.
ConnectionFactory
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the connection and free all resources asscociated with this connection.
|
Tree |
getAllocationHotspotBacktrace(ProfilingValue hotspot)
Calculates the back traces for an allocation hot spot.
|
AllocationHotspots |
getAllocationHotspots(Aggregation level,
Liveness liveness,
Descriptor[] classOrArrayDescriptors,
boolean resetGc,
boolean addFilteredToCalling)
Calculates the allocation hot spots for recorded objects of selected classes.
|
AllocationHotspots |
getAllocationHotspots(Aggregation level,
Liveness liveness,
java.lang.String packageName,
boolean resetGc,
boolean addFilteredToCalling)
Calculates the allocation hot spots for recorded objects of a selected package.
|
Tree |
getAllocationTree(Aggregation level,
Liveness liveness,
Descriptor[] classOrArrayDescriptors,
boolean resetGc)
Calculates the allocation tree for recorded objects of selected classes.
|
Tree |
getAllocationTree(Aggregation level,
Liveness liveness,
java.lang.String packageName,
boolean resetGc)
Calculates the allocation tree for recorded objects of a selected package.
|
Tree |
getCpuHotspotBacktrace(ProfilingValue hotspot)
Calculates the back traces for a CPU hot spot.
|
CpuHotspots |
getCpuHotspots(java.util.Collection<ThreadInfo> threads,
Aggregation level,
ThreadStatus status,
boolean addFilteredToCalling)
Calculates CPU hot spots.
|
Tree |
getCpuTree(java.util.Collection<ThreadInfo> threads,
Aggregation level,
ThreadStatus status)
Calculates the cumulated call tree.
|
Tree |
getPayloadHotspotBacktrace(ProfilingValue hotspot)
Calculates the back traces for a payload hot spot.
|
java.util.Collection<? extends ProfilingValue> |
getPayloadHotspots(java.lang.String payloadName,
java.util.Collection<ThreadInfo> threads,
Aggregation level,
ThreadStatus status)
Calculates hot spots for a non-method hot spot type.
|
ProbeInfo |
getProbeInfo()
Returns information about registered interceptors.
|
RecordedHeapUsage |
getRecordedHeapUsage(boolean resetGc)
Calculates the heap usage for all classes of recorded objects in the JVM.
|
java.util.Collection<ThreadInfo> |
getThreadInfos()
Returns information about all threads (live and dead) in the JVM.
|
java.util.Set<HeapValue> |
getTotalHeapUsage()
Calculates the total heap usage for all classes in the JVM.
|
void |
recordAllocations(boolean record)
Starts or stops recording allocations.
|
void |
recordCpuData(boolean record)
Starts or stops recording CPU data.
|
void |
recordPayload(boolean record,
java.lang.String payloadName)
Starts or stops payload recording.
|
void close()
void recordCpuData(boolean record)
record
- whether to record CPU data or notvoid recordAllocations(boolean record)
getTotalHeapUsage()
method
to get a statistics of all classes and their instances.record
- whether to record allocations or notvoid recordPayload(boolean record, java.lang.String payloadName)
PAYLOAD_NAME_*
constants in Payload
record
- whether to record payload data or notpayloadName
- the name of the payload. For custom probes you can pass the fully qualified class name of the custom probe or Payload.PAYLOAD_NAME_ALL_CUSTOM_PROBES
for all custom probes.ProbeInfo getProbeInfo()
CpuHotspots getCpuHotspots(java.util.Collection<ThreadInfo> threads, Aggregation level, ThreadStatus status, boolean addFilteredToCalling)
threads
- the threads for which to calculate the hot spots (see getThreadInfos()
) or null
if all threads should be cumulatedlevel
- the aggregation level for the hot spots and the back tracesstatus
- the thread status for the hot spots and the back tracesaddFilteredToCalling
- whether calls to filtered classes should be separate hot spots (true
) or be added to the calling methods (false
)getCpuHotspotBacktrace(com.jprofiler.api.platform.structures.ProfilingValue)
Tree getCpuHotspotBacktrace(ProfilingValue hotspot)
hotspot
argument is a method hot spot.hotspot
- the hot spot for which to calculate the back tracegetCpuHotspots
java.util.Collection<? extends ProfilingValue> getPayloadHotspots(java.lang.String payloadName, java.util.Collection<ThreadInfo> threads, Aggregation level, ThreadStatus status)
Payload types are selected by their payload id which is either one of the PAYLOAD_*
constants in Payload
or the payload id of a registered interceptor You can get the payload id from
ProbeInfo.getDescriptionToId()
.
The descriptor type of the ProfilingValue
objects
is either a PayloadDescriptor
or a URLDescriptor
.
payloadName
- the name of the payload type for which to calculate the hot spots. For custom probes, pass the fully qualified class name of the probe class.threads
- the threads for which to calculate the hot spots (see getThreadInfos()
) or null
if all threads should be cumulatedlevel
- the aggregation level for the hot spots and the back tracesstatus
- the thread status for the hot spots and the back tracesgetPayloadHotspotBacktrace(com.jprofiler.api.platform.structures.ProfilingValue)
Tree getPayloadHotspotBacktrace(ProfilingValue hotspot)
hotspot
argument is a payload hot spot.hotspot
- the hot spot for which to calculate the back tracegetPayloadHotspots
Tree getCpuTree(java.util.Collection<ThreadInfo> threads, Aggregation level, ThreadStatus status)
threads
- the threads for which to calculate the call tree (see getThreadInfos()
) or null
if all threads should be cumulatedlevel
- the aggregation level for the call treestatus
- the thread status for the call treejava.util.Collection<ThreadInfo> getThreadInfos()
java.util.Set<HeapValue> getTotalHeapUsage()
RecordedHeapUsage getRecordedHeapUsage(boolean resetGc)
resetGc
- whether to reset information about garbage collected objects after the requested information is retrieved.Tree getAllocationTree(Aggregation level, Liveness liveness, Descriptor[] classOrArrayDescriptors, boolean resetGc)
Liveness types that include garbage collected objects only work correctly if allocation recording options in the profiling settings include GCed objects.
level
- the aggregation level for the allocation treeliveness
- the object liveness for which the allocation tree should be calculatedclassOrArrayDescriptors
- the descriptors for the selected classes. You can get those descriptors from the
HeapValue
objects. If null
, the allocation tree is calculated for all classes.resetGc
- whether to reset information about garbage collected objects after the requested information is retrieved.Tree getAllocationTree(Aggregation level, Liveness liveness, java.lang.String packageName, boolean resetGc)
Liveness types that include garbage collected objects only work correctly if allocation recording options in the profiling settings include GCed objects.
level
- the aggregation level for the allocation treeliveness
- the object liveness for which the allocation tree should be calculatedpackageName
- the name of the selected package. If null
, the allocation tree is calculated for all classes.resetGc
- whether to reset information about garbage collected objects after the requested information is retrieved.AllocationHotspots getAllocationHotspots(Aggregation level, Liveness liveness, Descriptor[] classOrArrayDescriptors, boolean resetGc, boolean addFilteredToCalling)
Liveness types that include garbage collected objects only work correctly if allocation recording options in the profiling settings include GCed objects.
level
- the aggregation level for the allocation hot spots and back tracesliveness
- the object liveness for which the allocation hot spots should be calculatedclassOrArrayDescriptors
- the descriptors for the selected classes. You can get those descriptors from the
HeapValue
objects. If null
, the allocation hot spots are calculated for all classes.resetGc
- whether to reset information about garbage collected objects after the requested information is retrieved.addFilteredToCalling
- whether calls to filtered classes should be separate hot spots (true
) or be added to the calling methods (false
)getAllocationHotspotBacktrace(com.jprofiler.api.platform.structures.ProfilingValue)
AllocationHotspots getAllocationHotspots(Aggregation level, Liveness liveness, java.lang.String packageName, boolean resetGc, boolean addFilteredToCalling)
Liveness types that include garbage collected objects only work correctly if allocation recording options in the profiling settings include GCed objects.
level
- the aggregation level for the allocation hot spots and back tracesliveness
- the object liveness for which the allocation hot spots should be calculatedpackageName
- the name of the selected package. If null
, the allocation hot spots are calculated for all classes.resetGc
- whether to reset information about garbage collected objects after the requested information is retrieved.addFilteredToCalling
- whether calls to filtered classes should be separate hot spots (true
) or be added to the calling methods (false
)getAllocationHotspotBacktrace(com.jprofiler.api.platform.structures.ProfilingValue)
Tree getAllocationHotspotBacktrace(ProfilingValue hotspot)
hotspot
argument is an allocation hot spot.hotspot
- the allocation hot spot for which to calculate the back tracegetAllocationHotspots for selected classes
,
getAllocationHotspots for a selected package