Top Description Fields Constructors Methods
sun.jvmstat.perfdata.monitor.v1_0

public Class PerfDataBuffer

extends PerfDataBufferImpl
Class Inheritance
Imports
sun.jvmstat.monitor.*, sun.jvmstat.perfdata.monitor.*, java.util.*, java.nio.*

The concrete implementation of version 1.0 of the HotSpot PerfData Instrumentation buffer. This class is responsible for parsing the instrumentation memory and constructing the necessary objects to represent and access the instrumentation objects contained in the memory buffer.
Author
Brian Doherty
Since
1.5
See Also
AbstractPerfDataBuffer

Field Summary

Modifier and TypeField and Description
private static final ArrayList<Monitor>
pack-priv ArrayList<Monitor>
pack-priv long
pack-priv int
pack-priv int
pack-priv IntegerMonitor
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
pack-priv int
pack-priv int
pack-priv PerfDataBufferPrologue
private static final int
Inherited from sun.jvmstat.perfdata.monitor.PerfDataBufferImpl:
aliasCachealiasMapbufferlvmidmonitors

Constructor Summary

AccessConstructor and Description
public
PerfDataBuffer(ByteBuffer
the buffer containing the instrumentation data
buffer
,
int
the Local Java Virtual Machine Identifier for this instrumentation buffer.
lvmid
)

Construct a PerfDataBufferImpl instance.

Method Summary

Modifier and TypeMethod and Description
protected void
buildMonitorMap(Map<String, Monitor>
the map of Monitors.
map
)

Implements abstract sun.jvmstat.perfdata.monitor.PerfDataBufferImpl.buildMonitorMap.

build the map of Monitor objects.

protected void
buildPseudoMonitors(Map<String, Monitor> map)

Build the pseudo monitors used to map the prolog data into counters.

protected MonitorStatus
getMonitorStatus(Map<String, Monitor>
the map of Monitors.
map
)

Implements abstract sun.jvmstat.perfdata.monitor.PerfDataBufferImpl.getMonitorStatus.

get the list of inserted and removed monitors since last called.

protected void
getNewMonitors(Map<String, Monitor>
the map of Monitors.
map
)

Implements abstract sun.jvmstat.perfdata.monitor.PerfDataBufferImpl.getNewMonitors.

get the new Monitor objects from the Map of Monitor objects.

protected Monitor
getNextMonitorEntry()

method to extract the next monitor entry from the instrumentation memory.

protected Monitor
pollFor(Map<String, Monitor> map, String name, long timeLimit)

Method to poll the instrumentation memory for a counter with the given name.

protected void
synchWithTarget(Map<String, Monitor> map)

Method to provide a gross level of synchronization with the target monitored jvm.

Inherited from sun.jvmstat.perfdata.monitor.PerfDataBufferImpl:
findByAliasfindByNamefindByPatterngetBytesgetCapacitygetLocalVmIdgetMonitorStatus

Field Detail

EMPTY_LISTback to summary
private static final ArrayList<Monitor> EMPTY_LIST
insertedMonitorsback to summary
pack-priv ArrayList<Monitor> insertedMonitors
lastModificationTimeback to summary
pack-priv long lastModificationTime
lastUsedback to summary
pack-priv int lastUsed
nextEntryback to summary
pack-priv int nextEntry
overflowback to summary
pack-priv IntegerMonitor overflow
PERFDATA_DATAATTR_OFFSETback to summary
private static final int PERFDATA_DATAATTR_OFFSET
PERFDATA_DATAATTR_SIZEback to summary
private static final int PERFDATA_DATAATTR_SIZE
PERFDATA_DATATYPE_OFFSETback to summary
private static final int PERFDATA_DATATYPE_OFFSET
PERFDATA_DATATYPE_SIZEback to summary
private static final int PERFDATA_DATATYPE_SIZE
PERFDATA_DATAUNITS_OFFSETback to summary
private static final int PERFDATA_DATAUNITS_OFFSET
PERFDATA_DATAUNITS_SIZEback to summary
private static final int PERFDATA_DATAUNITS_SIZE
PERFDATA_ENTRYLENGTH_OFFSETback to summary
private static final int PERFDATA_ENTRYLENGTH_OFFSET
PERFDATA_ENTRYLENGTH_SIZEback to summary
private static final int PERFDATA_ENTRYLENGTH_SIZE
PERFDATA_FLAGS_OFFSETback to summary
private static final int PERFDATA_FLAGS_OFFSET
PERFDATA_FLAGS_SIZEback to summary
private static final int PERFDATA_FLAGS_SIZE
PERFDATA_NAME_OFFSETback to summary
private static final int PERFDATA_NAME_OFFSET
PERFDATA_NAMELENGTH_OFFSETback to summary
private static final int PERFDATA_NAMELENGTH_OFFSET
PERFDATA_NAMELENGTH_SIZEback to summary
private static final int PERFDATA_NAMELENGTH_SIZE
PERFDATA_VECTORLENGTH_OFFSETback to summary
private static final int PERFDATA_VECTORLENGTH_OFFSET
PERFDATA_VECTORLENGTH_SIZEback to summary
private static final int PERFDATA_VECTORLENGTH_SIZE
perfDataItemback to summary
pack-priv int perfDataItem
pollForEntryback to summary
pack-priv int pollForEntry
prologueback to summary
pack-priv PerfDataBufferPrologue prologue
syncWaitMsback to summary
private static final int syncWaitMs

Constructor Detail

PerfDataBufferback to summary
public PerfDataBuffer(ByteBuffer buffer, int lvmid) throws MonitorException

Construct a PerfDataBufferImpl instance.

This class is dynamically loaded by AbstractPerfDataBuffer#createPerfDataBuffer, and this constructor is called to instantiate the instance.

Parameters
buffer:ByteBuffer

the buffer containing the instrumentation data

lvmid:int

the Local Java Virtual Machine Identifier for this instrumentation buffer.

Method Detail

buildMonitorMapback to summary
protected void buildMonitorMap(Map<String, Monitor> map) throws MonitorException

Implements abstract sun.jvmstat.perfdata.monitor.PerfDataBufferImpl.buildMonitorMap.

Doc from sun.jvmstat.perfdata.monitor.PerfDataBufferImpl.buildMonitorMap.

build the map of Monitor objects.

Parameters
map:Map<String, Monitor>

the map of Monitors.

Exceptions
MonitorException:
Thrown if communications errors occur while communicating with the target.
buildPseudoMonitorsback to summary
protected void buildPseudoMonitors(Map<String, Monitor> map)

Build the pseudo monitors used to map the prolog data into counters.

getMonitorStatusback to summary
protected MonitorStatus getMonitorStatus(Map<String, Monitor> map) throws MonitorException

Implements abstract sun.jvmstat.perfdata.monitor.PerfDataBufferImpl.getMonitorStatus.

Doc from sun.jvmstat.perfdata.monitor.PerfDataBufferImpl.getMonitorStatus.

get the list of inserted and removed monitors since last called.

Parameters
map:Map<String, Monitor>

the map of Monitors.

Exceptions
MonitorException:
Thrown if communications errors occur while communicating with the target.
getNewMonitorsback to summary
protected void getNewMonitors(Map<String, Monitor> map) throws MonitorException

Implements abstract sun.jvmstat.perfdata.monitor.PerfDataBufferImpl.getNewMonitors.

Doc from sun.jvmstat.perfdata.monitor.PerfDataBufferImpl.getNewMonitors.

get the new Monitor objects from the Map of Monitor objects.

Parameters
map:Map<String, Monitor>

the map of Monitors.

Exceptions
MonitorException:
Thrown if communications errors occur while communicating with the target.
getNextMonitorEntryback to summary
protected Monitor getNextMonitorEntry() throws MonitorException

method to extract the next monitor entry from the instrumentation memory. assumes that nextEntry is the offset into the byte array at which to start the search for the next entry. method leaves next entry pointing to the next entry or to the end of data.

pollForback to summary
protected Monitor pollFor(Map<String, Monitor> map, String name, long timeLimit) throws MonitorException

Method to poll the instrumentation memory for a counter with the given name. The polling period is bounded by the timeLimit argument.

synchWithTargetback to summary
protected void synchWithTarget(Map<String, Monitor> map) throws MonitorException

Method to provide a gross level of synchronization with the target monitored jvm. gross synchronization works by polling for the hotspot.rt.hrt.ticks counter, which is the last counter created by the StatSampler initialization code. The counter is updated when the watcher thread starts scheduling tasks, which is the last thing done in vm initialization.