主权项 |
1. A computer program product for sampling transactions from multi-level log file records in a log file containing operation records, each operation record of a certain type and each operation record associated with a transaction, one operation record associated with a transaction being an end-of-transaction record indicating a completed transaction, the computer program product comprising:
one or more computer-readable storage media and program instructions stored on the one or more computer-readable storage media, the program instructions comprising: program instructions to read a plurality of the operation records from the log file into a record store; program instructions, for each operation record of the plurality of operation records read into the record store, to:
record in a transaction-to-record table an association of the operation record and the transaction to which the operation record belongs;sample operation records of the plurality of operation records of each operation record type at a predefined sampling rate;for each sampled operation record:
in response to determining that the sampled operation record is an end-of-transaction record, to extract all operation records that are associated with the transaction, based on the corresponding associations in the transaction-to-record table, from the record store into a data store;in response to determining that the sampled operation record is not an end-of-transaction record, to record in an extraction-pending table the transaction to which the operation record belongs; andprogram instructions, in response to determining that the operation record read from the log file is an end-of-transaction record and the transaction to which the operation record belongs is recorded in the extraction-pending table, to extract all operation records that are associated with the transaction, based on the corresponding associations in the transaction-to-record table, from the record store into the data store. |