Package com.blackhillsoftware.json.cics
CicsTransactionGroup
summarizes information from a group of
transactions.
CicsTransactionGroupFactory
creates multiple
CicsTransactionGroups
using a shared
configuration.
HashKey
provides a class that can be
used as a key when grouping transactions.
Usage
This example shows how to read and group CICS transaction data. It assumes you
have created a SmfRecordReader
to read the
data and configured it to include only SMF type 110 records.
- Create the CicsTransactionGroupFactory and modify the configuration as required.
- Create a HashMap mapping HashKey to CicsTransactionGroup
- Read the SMF records and sections and:
- Create the key from fields as required
- Use computeIfAbsent to check for an existing entry for that key and create a new group if required
- Add the data to the group
Summarized Data
Data in a CicsTransactionGroup is summarized as follows:
Numeric field Count/Packed
- min - minimum value
- max - maximum value
- total - the sum of values
Clock Field
- min - minimum value in seconds
- max - maximum value in seconds
- total - the sum of values in seconds
If
CicsTransactionGroupFactory.clockDetail(boolean)
equals true additional values are included: - count - the sum of count values from the clock entries, which is not necessarily the same as the number of transactions
- flags - flag values from all the transactions in the group are ORed to give the group flag value
Byte String Field
- values - an array of unique Strings
Timestamp Field
- min - minimum value
- max - maximum value
Errors
If errors were encountered reading data, an "errors" entry will be added with up to 3 different error messages.
Sample Code:
// Create the CicsTransactionGroupFactory and setup the configuration CicsTransactionGroupFactory factory = new CicsTransactionGroupFactory() .exclude(Field.START) .exclude(Field.STOP); Map<HashKey, CicsTransactionGroup> txGroups = new HashMap<>(); for (SmfRecord record : reader) { Smf110Record r110 = Smf110Record.from(record); for (PerformanceRecord txData : r110.performanceRecords()) { // Create the key to group transactions as required HashKey key = HashKey.of("tran", txData.getField(Field.TRAN)) .and("applid", r110.mnProductSection().smfmnprn()) .and("time", txData.getField(Field.STOP).truncatedTo(ChronoUnit.MINUTES)); // Get an existing or new group from the factory // and add the transaction information txGroups.computeIfAbsent(key, x -> factory.createGroup()) .add(txData); } }
-
ClassDescriptionSummarize CICS data from a group of transactions.A class to create
CicsTransactionGroup
objects with a shared configuration.