Skip to content

Commit

Permalink
chore(benchmarks): Warmup v2 (#2384)
Browse files Browse the repository at this point in the history
* 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 <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
sydney-munro and gcf-owl-bot[bot] authored Feb 6, 2024
1 parent 09428c2 commit 9ae7741
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand All @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ public String call() {
}
}
StorageSharedBenchmarkingUtils.cleanupObject(storage, created);
return "OK";
} catch (Exception e) {
CloudMonitoringResult result =
CloudMonitoringResult.newBuilder()
Expand All @@ -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) {
Expand Down

0 comments on commit 9ae7741

Please sign in to comment.