public final class PerformanceRecord extends SmfData
Monitoring Performance Records are returned in a list from
Smf110Record.performanceRecords()
Individual fields are extracted from the performance record by passing a
MonitoringField
to the getField(...)
method.
The MonitoringField classes define the specific fields to be retrieved.
A CICS Monitoring Dictionary is also required before fields can be retrieved. Dictionaries are
maintained automatically for each APPLID, but the record containing the dictionary must have been processed before you can call
getField(...)
.
You can use Smf110Record.haveDictionary()
to test whether
a dictionary is available for a specific CICS SMF record.
Specific fields are accessed by defining subclasses of
MonitoringFields
to define the specific field and type and accessing them like so:
ByteStringField transactionField = ByteStringField.define("DFHTASK","C001");
ClockField cpuField = ClockField.define("DFHTASK","S008");
try (SmfRecordReader reader =
SmfRecordReader.fromDD("INPUT"))
{
reader.include(110,1);
for (SmfRecord record : reader)
{
Smf110Record r110 = new Smf110Record(record);
if (r110.haveDictionary())
{
for (MonitoringPerformanceRecord mn : r110.performanceRecords())
{
String txName = mn.getField(transactionField);
double cpuTime = mn.getFieldTimerSeconds(cpuField);
// do stuff
}
}
}
}
Modifier and Type | Method and Description |
---|---|
static PerformanceRecord |
create(byte[] Data,
int offset,
int length,
Dictionary dictionary)
create is intended for internal use only.
|
Duration |
elapsed()
Transaction elapsed time - the Duration between START and STOP times.
|
double |
elapsedSeconds()
Transaction elapsed time in seconds - the number of seconds between START and STOP times.
|
String |
getField(ByteStringField field)
Get the value of a
ByteStringField as a String. |
CicsClock |
getField(ClockField field)
Get the value of a
ClockField as a CicsClock. |
long |
getField(CountField field)
Get the value of a
CountField as a long. |
Object |
getField(MonitoringField field)
Get the value of any type of
MonitoringField as an Object. |
long[] |
getField(MultiCountField field)
Get the value of a
MultiCountField as an array of longs. |
long |
getField(PackedField field)
Get the value of a
PackedField as a long. |
ZonedDateTime |
getField(TimestampField field)
Get the value of a
TimestampField as a ZonedDateTime. |
BigInteger |
getFieldAsBigInteger(CountField field)
Get the value of a
CountField as a BigInteger. |
List<BigInteger> |
getFieldAsBigInteger(MultiCountField field)
Get the value of a
MultiCountField as a List of BigIntegers. |
BigInteger |
getFieldAsBigInteger(PackedField field)
Get the value of a
PackedField as a BigInteger. |
int |
getFieldFlags(ClockField field)
Get the 8 reserved flag bits of a CICS
ClockField . |
int |
getFieldPeriodCount(ClockField field)
Get the period count of a CICS
ClockField . |
Duration |
getFieldTimer(ClockField field)
Get the value of the timer portion of a
ClockField as a Duration. |
double |
getFieldTimerSeconds(ClockField field)
Get the value of the timer portion of a
ClockField in seconds. |
boolean |
haveEntry(MonitoringField field)
Check whether we have a Dictionary Entry for a field identifier
|
createSection, dump, dump, dump, dump, equals, getBytes, getBytes, getDataArray, getTriplet, hashCode, toString
public static PerformanceRecord create(byte[] Data, int offset, int length, Dictionary dictionary)
Data
- Array of bytes containing data for this sectionoffset
- Offset of this section in the datalength
- length of the sectionpublic boolean haveEntry(MonitoringField field)
field
- a field (ClockField, CountField etc.)MonitoringField
public Object getField(MonitoringField field)
MonitoringField
as an Object.
The Object type returned depends on the specific MonitoringField type
field
- the MonitoringField
defining the specific fieldpublic Duration elapsed()
public double elapsedSeconds()
public long getField(CountField field)
CountField
as a long.
The field will be converted from 2, 4 or 8 bytes as appropriate.
If the value of the field
might exceed the maximum value of a signed 64 bit integer, use getFieldAsBigInteger(CountField)
.field
- the CountField
defining the specific fieldpublic BigInteger getFieldAsBigInteger(CountField field)
CountField
as a BigInteger.
The field will be converted from 4 or 8 bytes as appropriate. If the value of the field
will not exceed the maximum value of a signed 64 bit integer,
the long value returned by getField(CountField)
may
provide better performancefield
- the CountField
defining the specific fieldpublic long[] getField(MultiCountField field)
MultiCountField
as an array of longs.
The number of items in the array will be the field length divided by 8.
If the values of the field
might exceed the maximum value of a signed 64 bit integer, use getFieldAsBigInteger(MultiCountField)
.field
- the MultiCountField
defining the specific fieldpublic List<BigInteger> getFieldAsBigInteger(MultiCountField field)
MultiCountField
as a List of BigIntegers.
The number of items in the list will be the field length divided by 8.field
- the MultiCountField
defining the specific fieldpublic String getField(ByteStringField field)
ByteStringField
as a String.field
- the ByteStringField
defining the specific fieldpublic long getField(PackedField field)
PackedField
as a long.
If the number of digits exceeds 17, use getFieldAsBigInteger(PackedField)
field
- the PackedField
defining the specific fieldpublic BigInteger getFieldAsBigInteger(PackedField field)
PackedField
as a BigInteger.field
- the PackedField
defining the specific fieldpublic ZonedDateTime getField(TimestampField field)
TimestampField
as a ZonedDateTime.field
- the TimestampField
defining the specific fieldpublic CicsClock getField(ClockField field)
ClockField
as a CicsClock.field
- the ClockField
defining the specific fieldpublic Duration getFieldTimer(ClockField field)
ClockField
as a Duration.
The value is also available as a double in seconds, which may be more useful for calculations.
See getFieldTimerSeconds(ClockField)
.field
- the ClockField
defining the specific fieldpublic double getFieldTimerSeconds(ClockField field)
ClockField
in seconds.field
- the ClockField
defining the specific fieldpublic int getFieldFlags(ClockField field)
ClockField
.
Returned as an integer with the bit values in the last 8 bits.field
- the ClockField
defining the specific fieldpublic int getFieldPeriodCount(ClockField field)
ClockField
.field
- the ClockField
defining the specific fieldCopyright © 2020 Black Hill Software Pty Ltd. All rights reserved.