From 9ae7741805b4937d5ce1a7b83fa62baeade03b79 Mon Sep 17 00:00:00 2001 From: Sydney Munro <97561403+sydney-munro@users.noreply.github.com> Date: Tue, 6 Feb 2024 11:13:16 -0800 Subject: [PATCH] chore(benchmarks): Warmup v2 (#2384) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(benchmarking): Move warmup out of sample runs and fix throughput on fail * Exiting with fail if we catch an error * fix metric formatting * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot --- .../storage/benchmarking/StorageSharedBenchmarkingCli.java | 4 +++- .../java/com/google/cloud/storage/benchmarking/W1R3.java | 7 +++---- 2 files changed, 6 insertions(+), 5 deletions(-) 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) {