io.airlift.stats.TimeStat Java Examples

The following examples show how to use io.airlift.stats.TimeStat. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BackupOperationStats.java    From presto with Apache License 2.0 6 votes vote down vote up
public <V> V run(Supplier<V> supplier)
{
    try (TimeStat.BlockTimer ignored = time.time()) {
        V value = supplier.get();
        successes.update(1);
        return value;
    }
    catch (PrestoException e) {
        if (e.getErrorCode().equals(RAPTOR_BACKUP_NOT_FOUND.toErrorCode())) {
            successes.update(1);
        }
        else if (e.getErrorCode().equals(RAPTOR_BACKUP_TIMEOUT.toErrorCode())) {
            timeouts.update(1);
        }
        else {
            failures.update(1);
        }
        throw e;
    }
}
 
Example #2
Source File: PrioritizedSplitRunner.java    From presto with Apache License 2.0 6 votes vote down vote up
PrioritizedSplitRunner(
        TaskHandle taskHandle,
        SplitRunner split,
        Ticker ticker,
        CounterStat globalCpuTimeMicros,
        CounterStat globalScheduledTimeMicros,
        TimeStat blockedQuantaWallTime,
        TimeStat unblockedQuantaWallTime)
{
    this.taskHandle = taskHandle;
    this.splitId = taskHandle.getNextSplitId();
    this.split = split;
    this.ticker = ticker;
    this.workerId = NEXT_WORKER_ID.getAndIncrement();
    this.globalCpuTimeMicros = globalCpuTimeMicros;
    this.globalScheduledTimeMicros = globalScheduledTimeMicros;
    this.blockedQuantaWallTime = blockedQuantaWallTime;
    this.unblockedQuantaWallTime = unblockedQuantaWallTime;

    this.updateLevelPriority();
}
 
Example #3
Source File: JdbcApiStats.java    From presto with Apache License 2.0 5 votes vote down vote up
public <E extends Exception> void wrap(ThrowingRunnable<E> callable)
        throws E
{
    try (TimeStat.BlockTimer ignored = time.time()) {
        callable.run();
    }
    catch (Exception e) {
        failures.update(1);
        throw e;
    }
}
 
Example #4
Source File: HiveFileIterator.java    From presto with Apache License 2.0 5 votes vote down vote up
private Iterator<LocatedFileStatus> getLocatedFileStatusRemoteIterator(Path path)
{
    try (TimeStat.BlockTimer ignored = namenodeStats.getListLocatedStatus().time()) {
        if (ignoreAbsentPartitions && !exists(path)) {
            return emptyIterator();
        }
        return new FileStatusIterator(table, path, fileSystem, directoryLister, namenodeStats);
    }
}
 
Example #5
Source File: GlueMetastoreApiStats.java    From presto with Apache License 2.0 5 votes vote down vote up
public <V, E extends Exception> V call(ThrowingCallable<V, E> callable)
        throws E
{
    try (TimeStat.BlockTimer ignored = time.time()) {
        return callable.call();
    }
    catch (Exception e) {
        totalFailures.update(1);
        throw e;
    }
}
 
Example #6
Source File: ThriftMetastoreApiStats.java    From presto with Apache License 2.0 5 votes vote down vote up
public <V> Callable<V> wrap(Callable<V> callable)
{
    return () -> {
        try (TimeStat.BlockTimer ignored = time.time()) {
            return callable.call();
        }
        catch (Exception e) {
            if (e instanceof MetaException) {
                metastoreExceptions.update(1);
                // Need to throw here instead of falling through due to JDK-8059299
                totalFailures.update(1);
                throw e;
            }

            if (e instanceof TException) {
                if (e instanceof TBase) {
                    // This exception is an API response and not a server error
                    throw e;
                }

                thriftExceptions.update(1);
                // Need to throw here instead of falling through due to JDK-8059299
                totalFailures.update(1);
                throw e;
            }

            totalFailures.update(1);
            throw e;
        }
    };
}
 
Example #7
Source File: JdbcApiStats.java    From presto with Apache License 2.0 5 votes vote down vote up
public <V, E extends Exception> V wrap(ThrowingCallable<V, E> callable)
        throws E
{
    try (TimeStat.BlockTimer ignored = time.time()) {
        return callable.call();
    }
    catch (Exception e) {
        failures.update(1);
        throw e;
    }
}
 
Example #8
Source File: PinotMetricsStats.java    From presto with Apache License 2.0 4 votes vote down vote up
@Managed
@Nested
public TimeStat getTime()
{
    return time;
}
 
Example #9
Source File: ThriftMetastoreApiStats.java    From presto with Apache License 2.0 4 votes vote down vote up
@Managed
@Nested
public TimeStat getTime()
{
    return time;
}
 
Example #10
Source File: JmxMethodInvocationStat.java    From drift with Apache License 2.0 4 votes vote down vote up
@Managed
@Nested
public TimeStat getTime()
{
    return time;
}
 
Example #11
Source File: GlueMetastoreApiStats.java    From presto with Apache License 2.0 4 votes vote down vote up
@Managed
@Nested
public TimeStat getTime()
{
    return time;
}
 
Example #12
Source File: JmxMethodInvocationStat.java    From drift with Apache License 2.0 4 votes vote down vote up
@Managed
@Nested
public TimeStat getTime()
{
    return time;
}
 
Example #13
Source File: PrestoS3FileSystemStats.java    From spliceengine with GNU Affero General Public License v3.0 4 votes vote down vote up
@Managed
@Nested
public TimeStat getAwsRequestTime()
{
    return awsRequestTime;
}
 
Example #14
Source File: HiveFileIterator.java    From presto with Apache License 2.0 4 votes vote down vote up
private LocatedFileStatus getLocatedFileStatus(Iterator<LocatedFileStatus> iterator)
{
    try (TimeStat.BlockTimer ignored = namenodeStats.getRemoteIteratorNext().time()) {
        return iterator.next();
    }
}
 
Example #15
Source File: PrestoS3FileSystemStats.java    From presto with Apache License 2.0 4 votes vote down vote up
@Managed
@Nested
public TimeStat getAwsClientRetryPauseTime()
{
    return awsClientRetryPauseTime;
}
 
Example #16
Source File: PrestoS3FileSystemStats.java    From spliceengine with GNU Affero General Public License v3.0 4 votes vote down vote up
@Managed
@Nested
public TimeStat getAwsClientExecuteTime()
{
    return awsClientExecuteTime;
}
 
Example #17
Source File: PrestoS3FileSystemStats.java    From presto with Apache License 2.0 4 votes vote down vote up
@Managed
@Nested
public TimeStat getAwsClientExecuteTime()
{
    return awsClientExecuteTime;
}
 
Example #18
Source File: PrestoS3FileSystemStats.java    From presto with Apache License 2.0 4 votes vote down vote up
@Managed
@Nested
public TimeStat getAwsRequestTime()
{
    return awsRequestTime;
}
 
Example #19
Source File: NamenodeStats.java    From presto with Apache License 2.0 4 votes vote down vote up
@Managed
@Nested
public TimeStat getTime()
{
    return time;
}
 
Example #20
Source File: NamenodeStats.java    From presto with Apache License 2.0 4 votes vote down vote up
public TimeStat.BlockTimer time()
{
    return time.time();
}
 
Example #21
Source File: FileFormatDataSourceStats.java    From presto with Apache License 2.0 4 votes vote down vote up
@Managed
@Nested
public TimeStat get10MBPlus()
{
    return time10MBPlus;
}
 
Example #22
Source File: TaskExecutor.java    From presto with Apache License 2.0 4 votes vote down vote up
@Managed
@Nested
public TimeStat getUnblockedQuantaWallTime()
{
    return unblockedQuantaWallTime;
}
 
Example #23
Source File: JdbcApiStats.java    From presto with Apache License 2.0 4 votes vote down vote up
@Managed
@Nested
public TimeStat getTime()
{
    return time;
}
 
Example #24
Source File: SplitSchedulerStats.java    From presto with Apache License 2.0 4 votes vote down vote up
@Managed
@Nested
public TimeStat getSleepTime()
{
    return sleepTime;
}
 
Example #25
Source File: SplitSchedulerStats.java    From presto with Apache License 2.0 4 votes vote down vote up
@Managed
@Nested
public TimeStat getGetSplitTime()
{
    return getSplitTime;
}
 
Example #26
Source File: QueryManagerStats.java    From presto with Apache License 2.0 4 votes vote down vote up
@Managed
@Nested
public TimeStat getExecutionTime()
{
    return executionTime;
}
 
Example #27
Source File: QueryManagerStats.java    From presto with Apache License 2.0 4 votes vote down vote up
@Managed
@Nested
public TimeStat getQueuedTime()
{
    return queuedTime;
}
 
Example #28
Source File: TaskExecutor.java    From presto with Apache License 2.0 4 votes vote down vote up
@Managed
@Nested
public TimeStat getSplitQueuedTime()
{
    return splitQueuedTime;
}
 
Example #29
Source File: TaskExecutor.java    From presto with Apache License 2.0 4 votes vote down vote up
@Managed
@Nested
public TimeStat getSplitWallTime()
{
    return splitWallTime;
}
 
Example #30
Source File: TaskExecutor.java    From presto with Apache License 2.0 4 votes vote down vote up
@Managed
@Nested
public TimeStat getBlockedQuantaWallTime()
{
    return blockedQuantaWallTime;
}