/** * Writes data to the given file of the given size, flushing every * x bytes. Measure performance of that and return it. */ private static TestResult writeTestFile(NativeAzureFileSystem fs, Path path, long size, long flushInterval) throws IOException { AzureFileSystemInstrumentation instrumentation = fs.getInstrumentation(); long initialRequests = instrumentation.getCurrentWebResponses(); Date start = new Date(); OutputStream output = fs.create(path); writeTestFile(output, size, flushInterval); output.close(); long finalRequests = instrumentation.getCurrentWebResponses(); return new TestResult(new Date().getTime() - start.getTime(), finalRequests - initialRequests); }
/** * Writes data to the given file of the given size, flushing every * x bytes. Measure performance of that and return it. */ private static TestResult writeTestFile(NativeAzureFileSystem fs, Path path, long size, long flushInterval) throws IOException { AzureFileSystemInstrumentation instrumentation = fs.getInstrumentation(); long initialRequests = instrumentation.getCurrentWebResponses(); Date start = new Date(); OutputStream output = fs.create(path); writeTestFile(output, size, flushInterval); output.close(); long finalRequests = instrumentation.getCurrentWebResponses(); return new TestResult(new Date().getTime() - start.getTime(), finalRequests - initialRequests); }