use of org.apache.ignite.testframework.MessageOrderLogListener in project ignite by apache.
the class GridTransactionsSystemUserTimeMetricsTest method testLongTransactionDumpLimit.
/**
* Tests that tx time dumps appear in log correctly and after tx completion. Also checks that LRT dump
* now contains information about current system and user time.
*
* @throws Exception If failed.
*/
@Test
public void testLongTransactionDumpLimit() throws Exception {
logTxDumpLsnr.reset();
transactionDumpLsnr.reset();
int txCnt = 10;
List<String> txLogLines = new LinkedList<>();
txLogLines.add("First 10 long running transactions \\[total=" + txCnt + "\\]");
for (int i = 0; i < txCnt; i++) txLogLines.add(".*?>>> Transaction .*? systemTime=[0-4]{1,4}, userTime=[0-4]{1,4}.*");
LogListener lrtLogLsnr = new MessageOrderLogListener(txLogLines.toArray(new String[0]));
listeningTestLog.registerListener(lrtLogLsnr);
applyJmxParameters(5000L, null, txCnt);
doAsyncTransactions(client, txCnt, 5200);
doSleep(3000);
assertFalse(logTxDumpLsnr.check());
doSleep(3000);
assertTrue(logTxDumpLsnr.check());
assertTrue(transactionDumpLsnr.check());
assertTrue(lrtLogLsnr.check());
assertEquals(txCnt, transactionDumpLsnr.value());
}
use of org.apache.ignite.testframework.MessageOrderLogListener in project ignite by apache.
the class GridCommandHandlerIndexForceRebuildTest method installRebuildCheckListener.
/**
* @param ignite IgniteEx instance.
* @param cacheName Name of checked cache.
* @return newly installed LogListener.
*/
private LogListener installRebuildCheckListener(IgniteEx ignite, String cacheName) {
final MessageOrderLogListener lsnr = new MessageOrderLogListener(new MessageOrderLogListener.MessageGroup(true).add("Started indexes rebuilding for cache \\[name=" + cacheName + ".*").add("Finished indexes rebuilding for cache \\[name=" + cacheName + ".*"));
ListeningTestLogger impl = GridTestUtils.getFieldValue(ignite.log(), "impl");
assertNotNull(impl);
impl.registerListener(lsnr);
return lsnr;
}
Aggregations