本文整理了Java中com.facebook.presto.execution.QueryManager.getStats
方法的一些代码示例,展示了QueryManager.getStats
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QueryManager.getStats
方法的具体详情如下:
包路径:com.facebook.presto.execution.QueryManager
类名称:QueryManager
方法名:getStats
暂无
代码示例来源:origin: prestodb/presto
@Test
public void testQueryLoggingCount()
{
QueryManager queryManager = ((DistributedQueryRunner) getQueryRunner()).getCoordinator().getQueryManager();
executeExclusively(() -> {
assertUntilTimeout(
() -> assertEquals(
queryManager.getQueries().stream()
.map(BasicQueryInfo::getQueryId)
.map(queryManager::getFullQueryInfo)
.filter(info -> !info.isFinalQueryInfo())
.collect(toList()),
ImmutableList.of()),
new Duration(1, MINUTES));
// We cannot simply get the number of completed queries as soon as all the queries are completed, because this counter may not be up-to-date at that point.
// The completed queries counter is updated in a final query info listener, which is called eventually.
// Therefore, here we wait until the value of this counter gets stable.
long beforeCompletedQueriesCount = waitUntilStable(() -> queryManager.getStats().getCompletedQueries().getTotalCount(), new Duration(5, SECONDS));
long beforeSubmittedQueriesCount = queryManager.getStats().getSubmittedQueries().getTotalCount();
assertUpdate("CREATE TABLE test_query_logging_count AS SELECT 1 foo_1, 2 foo_2_4", 1);
assertQuery("SELECT foo_1, foo_2_4 FROM test_query_logging_count", "SELECT 1, 2");
assertUpdate("DROP TABLE test_query_logging_count");
assertQueryFails("SELECT * FROM test_query_logging_count", ".*Table .* does not exist");
// TODO: Figure out a better way of synchronization
assertUntilTimeout(
() -> assertEquals(queryManager.getStats().getCompletedQueries().getTotalCount() - beforeCompletedQueriesCount, 4),
new Duration(1, MINUTES));
assertEquals(queryManager.getStats().getSubmittedQueries().getTotalCount() - beforeSubmittedQueriesCount, 4);
});
}
代码示例来源:origin: prestodb/presto
double memoryReservation = 0;
long totalInputRows = queryManager.getStats().getConsumedInputRows().getTotalCount();
long totalInputBytes = queryManager.getStats().getConsumedInputBytes().getTotalCount();
long totalCpuTimeSecs = queryManager.getStats().getConsumedCpuTimeSecs().getTotalCount();
代码示例来源:origin: com.facebook.presto/presto-tests
@Test
public void testQueryLoggingCount()
{
QueryManager queryManager = ((DistributedQueryRunner) getQueryRunner()).getCoordinator().getQueryManager();
executeExclusively(() -> {
assertUntilTimeout(
() -> assertEquals(
queryManager.getQueries().stream()
.map(BasicQueryInfo::getQueryId)
.map(queryManager::getFullQueryInfo)
.filter(info -> !info.isFinalQueryInfo())
.collect(toList()),
ImmutableList.of()),
new Duration(1, MINUTES));
// We cannot simply get the number of completed queries as soon as all the queries are completed, because this counter may not be up-to-date at that point.
// The completed queries counter is updated in a final query info listener, which is called eventually.
// Therefore, here we wait until the value of this counter gets stable.
long beforeCompletedQueriesCount = waitUntilStable(() -> queryManager.getStats().getCompletedQueries().getTotalCount(), new Duration(5, SECONDS));
long beforeSubmittedQueriesCount = queryManager.getStats().getSubmittedQueries().getTotalCount();
assertUpdate("CREATE TABLE test_query_logging_count AS SELECT 1 foo_1, 2 foo_2_4", 1);
assertQuery("SELECT foo_1, foo_2_4 FROM test_query_logging_count", "SELECT 1, 2");
assertUpdate("DROP TABLE test_query_logging_count");
assertQueryFails("SELECT * FROM test_query_logging_count", ".*Table .* does not exist");
// TODO: Figure out a better way of synchronization
assertUntilTimeout(
() -> assertEquals(queryManager.getStats().getCompletedQueries().getTotalCount() - beforeCompletedQueriesCount, 4),
new Duration(1, MINUTES));
assertEquals(queryManager.getStats().getSubmittedQueries().getTotalCount() - beforeSubmittedQueriesCount, 4);
});
}
内容来源于网络,如有侵权,请联系作者删除!