use of org.apache.tez.util.StopWatch in project tez by apache.
the class TezUtilsInternal method uncompressBytes.
public static byte[] uncompressBytes(byte[] inBytes) throws IOException {
StopWatch sw = new StopWatch().start();
byte[] uncompressed = uncompressBytesInflateDeflate(inBytes);
sw.stop();
if (LOG.isDebugEnabled()) {
LOG.debug("CompressedSize: " + inBytes.length + ", UncompressedSize: " + uncompressed.length + ", UncompressTimeTaken: " + sw.now(TimeUnit.MILLISECONDS));
}
return uncompressed;
}
use of org.apache.tez.util.StopWatch in project tez by apache.
the class TestMemoryWithEvents method testMemory.
private void testMemory(DAG dag, boolean sendDMEvents) throws Exception {
StopWatch stopwatch = new StopWatch();
stopwatch.start();
TezConfiguration tezconf = new TezConfiguration(defaultConf);
MockTezClient tezClient = new MockTezClient("testMockAM", tezconf, true, null, null, null, null, false, false, numThreads, 1000);
tezClient.start();
MockDAGAppMaster mockApp = tezClient.getLocalClient().getMockApp();
MockContainerLauncher mockLauncher = mockApp.getContainerLauncher();
mockLauncher.startScheduling(false);
mockApp.eventsDelegate = new TestMockDAGAppMaster.TestEventsDelegate();
mockApp.doSleep = false;
DAGClient dagClient = tezClient.submitDAG(dag);
mockLauncher.waitTillContainersLaunched();
mockLauncher.startScheduling(true);
DAGStatus status = dagClient.waitForCompletion();
Assert.assertEquals(DAGStatus.State.SUCCEEDED, status.getState());
checkMemory(dag.getName(), mockApp);
stopwatch.stop();
System.out.println("Time taken(ms): " + stopwatch.now(TimeUnit.MILLISECONDS));
tezClient.stop();
}
Aggregations