diff --git a/storage-shared-benchmarking/src/main/java/com/google/cloud/storage/benchmarking/StorageSharedBenchmarkingCli.java b/storage-shared-benchmarking/src/main/java/com/google/cloud/storage/benchmarking/StorageSharedBenchmarkingCli.java index d2df5fcab5..c699a39b06 100644 --- a/storage-shared-benchmarking/src/main/java/com/google/cloud/storage/benchmarking/StorageSharedBenchmarkingCli.java +++ b/storage-shared-benchmarking/src/main/java/com/google/cloud/storage/benchmarking/StorageSharedBenchmarkingCli.java @@ -124,6 +124,7 @@ private void runWorkload1() { runW1R3(storageClient); } catch (Exception e) { System.err.println("Failed to run workload 1: " + e.getMessage()); + System.exit(1); } } @@ -136,14 +137,15 @@ private void runWorkload4() { runW1R3(storageClient); } catch (Exception e) { System.err.println("Failed to run workload 4: " + e.getMessage()); + System.exit(1); } } private void runW1R3(Storage storageClient) throws ExecutionException, InterruptedException { ListeningExecutorService executorService = MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(workers)); + runWarmup(storageClient); for (int i = 0; i < samples; i++) { - runWarmup(storageClient); Range objectSizeRange = Range.of(objectSize); int objectSize = getRandomInt(objectSizeRange.min, objectSizeRange.max); convert( diff --git a/storage-shared-benchmarking/src/main/java/com/google/cloud/storage/benchmarking/W1R3.java b/storage-shared-benchmarking/src/main/java/com/google/cloud/storage/benchmarking/W1R3.java index 123658a1af..83b357db27 100644 --- a/storage-shared-benchmarking/src/main/java/com/google/cloud/storage/benchmarking/W1R3.java +++ b/storage-shared-benchmarking/src/main/java/com/google/cloud/storage/benchmarking/W1R3.java @@ -81,7 +81,6 @@ public String call() { } } StorageSharedBenchmarkingUtils.cleanupObject(storage, created); - return "OK"; } catch (Exception e) { CloudMonitoringResult result = CloudMonitoringResult.newBuilder() @@ -97,11 +96,11 @@ public String call() { .setBucketName("") .setStatus("FAIL") .setTransferSize("") - .setThroughput(-1) + .setThroughput(0) .build(); - printWriter.println(result); - return "FAIL"; + printWriter.println(result.formatAsCustomMetric()); } + return "OK"; } private void printResult(String op, Blob created, Duration duration) {