@Override public HashCollisionsInfo get() { return createHashCollisionsInfo(operatorContext.getInputPositions().getTotalCount(), hashCollisions, expectedHashCollisions); } }
public void testInvalidDbGetTable() { assertFalse(metastore.getTable(BAD_DATABASE, TEST_TABLE).isPresent()); assertEquals(stats.getGetTable().getThriftExceptions().getTotalCount(), 0); assertEquals(stats.getGetTable().getTotalFailures().getTotalCount(), 0); }
@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); }); }
OperatorInfo info = Optional.ofNullable(infoSupplier).map(Supplier::get).orElse(null); long inputPositionsCount = inputPositions.getTotalCount(); succinctNanos(addInputTiming.getWallNanos()), succinctNanos(addInputTiming.getCpuNanos()), succinctBytes(rawInputDataSize.getTotalCount()), succinctBytes(inputDataSize.getTotalCount()), inputPositionsCount, (double) inputPositionsCount * inputPositionsCount, succinctNanos(getOutputTiming.getWallNanos()), succinctNanos(getOutputTiming.getCpuNanos()), succinctBytes(outputDataSize.getTotalCount()), outputPositions.getTotalCount(),
long totalBlockedTime = this.totalBlockedTime.get(); long rawInputDataSize = this.rawInputDataSize.getTotalCount(); long rawInputPositions = this.rawInputPositions.getTotalCount(); long processedInputDataSize = this.processedInputDataSize.getTotalCount(); long processedInputPositions = this.processedInputPositions.getTotalCount(); long outputDataSize = this.outputDataSize.getTotalCount(); long outputPositions = this.outputPositions.getTotalCount();
@SuppressWarnings({"OverlyStrongTypeCast", "ConstantConditions"}) @Test public void testGetMetadataRetryCounter() { int maxRetries = 2; try (PrestoS3FileSystem fs = new PrestoS3FileSystem()) { MockAmazonS3 s3 = new MockAmazonS3(); s3.setGetObjectMetadataHttpCode(SC_INTERNAL_SERVER_ERROR); Configuration configuration = new Configuration(); configuration.set(S3_MAX_BACKOFF_TIME, "1ms"); configuration.set(S3_MAX_RETRY_TIME, "5s"); configuration.setInt(S3_MAX_CLIENT_RETRIES, maxRetries); fs.initialize(new URI("s3n://test-bucket/"), configuration); fs.setS3Client(s3); fs.getS3ObjectMetadata(new Path("s3n://test-bucket/test")); } catch (Throwable expected) { assertInstanceOf(expected, AmazonS3Exception.class); assertEquals(((AmazonS3Exception) expected).getStatusCode(), SC_INTERNAL_SERVER_ERROR); assertEquals(PrestoS3FileSystem.getFileSystemStats().getGetMetadataRetries().getTotalCount(), maxRetries); } }
@SuppressWarnings({"ResultOfMethodCallIgnored", "OverlyStrongTypeCast", "ConstantConditions"}) @Test public void testReadRetryCounters() throws Exception { try (PrestoS3FileSystem fs = new PrestoS3FileSystem()) { int maxRetries = 2; MockAmazonS3 s3 = new MockAmazonS3(); s3.setGetObjectHttpErrorCode(SC_INTERNAL_SERVER_ERROR); Configuration configuration = new Configuration(); configuration.set(S3_MAX_BACKOFF_TIME, "1ms"); configuration.set(S3_MAX_RETRY_TIME, "5s"); configuration.setInt(S3_MAX_CLIENT_RETRIES, maxRetries); fs.initialize(new URI("s3n://test-bucket/"), configuration); fs.setS3Client(s3); try (FSDataInputStream inputStream = fs.open(new Path("s3n://test-bucket/test"))) { inputStream.read(); } catch (Throwable expected) { assertInstanceOf(expected, AmazonS3Exception.class); assertEquals(((AmazonS3Exception) expected).getStatusCode(), SC_INTERNAL_SERVER_ERROR); assertEquals(PrestoS3FileSystem.getFileSystemStats().getReadRetries().getTotalCount(), maxRetries); assertEquals(PrestoS3FileSystem.getFileSystemStats().getGetObjectRetries().getTotalCount(), (maxRetries + 1L) * maxRetries); } } }
double memoryReservation = 0; long totalInputRows = queryManager.getStats().getConsumedInputRows().getTotalCount(); long totalInputBytes = queryManager.getStats().getConsumedInputBytes().getTotalCount(); long totalCpuTimeSecs = queryManager.getStats().getConsumedCpuTimeSecs().getTotalCount();
@Override public String toString() { return toStringHelper(this) .add("name", name) .add("successes", successes.getTotalCount()) .add("failures", failures.getTotalCount()) .toString(); } }
@Override public String toString() { return toStringHelper(this) .add("name", name) .add("successes", successes.getTotalCount()) .add("failures", failures.getTotalCount()) .add("retries", retries.getTotalCount()) .toString(); } }
@Override public String toString() { return toStringHelper(this) .add("name", name) .add("successes", successes.getTotalCount()) .add("failures", failures.getTotalCount()) .toString(); } }
@Managed public long getRunningSplits() { return Math.max(0, startedSplits.getTotalCount() - completedSplits.getTotalCount()); }
@Override public HashCollisionsInfo get() { return createHashCollisionsInfo(operatorContext.getInputPositions().getTotalCount(), hashCollisions, expectedHashCollisions); } }
public void merge(CounterStat counterStat) { requireNonNull(counterStat, "counterStat is null"); oneMinute.merge(counterStat.getOneMinute()); fiveMinute.merge(counterStat.getFiveMinute()); fifteenMinute.merge(counterStat.getFifteenMinute()); count.addAndGet(counterStat.getTotalCount()); }
public void merge(CounterStat counterStat) { requireNonNull(counterStat, "counterStat is null"); oneMinute.merge(counterStat.getOneMinute()); fiveMinute.merge(counterStat.getFiveMinute()); fifteenMinute.merge(counterStat.getFifteenMinute()); count.addAndGet(counterStat.getTotalCount()); }
/** * This is a hack to work around limitations in Jmxutils. */ @Deprecated public void resetTo(CounterStat counterStat) { oneMinute.resetTo(counterStat.getOneMinute()); fiveMinute.resetTo(counterStat.getFiveMinute()); fifteenMinute.resetTo(counterStat.getFifteenMinute()); count.set(counterStat.getTotalCount()); }
private void assertBackupStats(int successCount, int failureCount, int corruptionCount) { BackupStats stats = backupManager.getStats(); assertEquals(stats.getBackupSuccess().getTotalCount(), successCount); assertEquals(stats.getBackupFailure().getTotalCount(), failureCount); assertEquals(stats.getBackupCorruption().getTotalCount(), corruptionCount); }
/** * This is a hack to work around limitations in Jmxutils. */ @Deprecated public void resetTo(CounterStat counterStat) { oneMinute.resetTo(counterStat.getOneMinute()); fiveMinute.resetTo(counterStat.getFiveMinute()); fifteenMinute.resetTo(counterStat.getFifteenMinute()); count.set(counterStat.getTotalCount()); }
public void testInvalidDbGetTable() throws Exception { assertFalse(metastore.getTable(BAD_DATABASE, TEST_TABLE).isPresent()); assertEquals(stats.getGetTable().getThriftExceptions().getTotalCount(), 0); assertEquals(stats.getGetTable().getTotalFailures().getTotalCount(), 0); }
public void testInvalidDbGetTable() { assertFalse(metastore.getTable(BAD_DATABASE, TEST_TABLE).isPresent()); assertEquals(stats.getGetTable().getThriftExceptions().getTotalCount(), 0); assertEquals(stats.getGetTable().getTotalFailures().getTotalCount(), 0); }