Search in sources :

Example 11 with Stopwatch

use of org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Stopwatch in project beam by apache.

the class GcsFileSystem method copy.

@Override
protected void copy(List<GcsResourceId> srcResourceIds, List<GcsResourceId> destResourceIds) throws IOException {
    Stopwatch stopwatch = Stopwatch.createStarted();
    options.getGcsUtil().copy(toFilenames(srcResourceIds), toFilenames(destResourceIds));
    stopwatch.stop();
    if (options.getGcsPerformanceMetrics()) {
        numCopies.inc(srcResourceIds.size());
        copyTimeMsec.inc(stopwatch.elapsed(TimeUnit.MILLISECONDS));
    }
}
Also used : Stopwatch(org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Stopwatch)

Aggregations

Stopwatch (org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Stopwatch)11 Test (org.junit.Test)6 ArrayList (java.util.ArrayList)3 Duration (org.joda.time.Duration)3 Instant (org.joda.time.Instant)3 Collections (java.util.Collections)2 Collections.singletonList (java.util.Collections.singletonList)2 List (java.util.List)2 TimeUnit (java.util.concurrent.TimeUnit)2 WindowedValue (org.apache.beam.sdk.util.WindowedValue)2 ImmutableList (org.apache.beam.vendor.guava.v26_0_jre.com.google.common.collect.ImmutableList)2 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)2 After (org.junit.After)2 Before (org.junit.Before)2 RunWith (org.junit.runner.RunWith)2 ArgumentMatchers.any (org.mockito.ArgumentMatchers.any)2 ArgumentMatchers.eq (org.mockito.ArgumentMatchers.eq)2 ArgumentMatchers.same (org.mockito.ArgumentMatchers.same)2 Mock (org.mockito.Mock)2 Mockito (org.mockito.Mockito)2