Skip to content

Commit

Permalink
#141 Writing calls per second.
Browse files Browse the repository at this point in the history
  • Loading branch information
jzonthemtn committed Nov 16, 2024
1 parent 731fd25 commit 89658ec
Showing 1 changed file with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ static boolean benchmarksEnabled() {
public void runBenchmarks() throws Exception {

final String branch = getGitBranch();
final String runId = UUID.randomUUID().toString();

final Collection<Result> results = new LinkedList<>();

Expand Down Expand Up @@ -82,6 +81,7 @@ public void runBenchmarks() throws Exception {

// calls_per_second
final Result result = new Result();
result.setRunId(UUID.randomUUID().toString());
result.setCallsPerSecond(calls);
result.setDocument(document);
result.setWorkloadMillis(workload_millis);
Expand Down Expand Up @@ -118,8 +118,21 @@ INSERT INTO benchmarks(document, workload_mills, redactor, timestamp, phileas_ve
statement.setLong(4, result.getTimestamp());
statement.setString(5, result.getPhileasVersion());
statement.setString(6, result.getBranch());
statement.setString(7, runId);
statement.setString(7, result.getRunId());
statement.executeUpdate();
}

for(final Integer i : result.getCallsPerSecond().keySet()) {

try (PreparedStatement statement = connection.prepareStatement("""
INSERT INTO calls_per_second(length, calls_per_second, run_id)
VALUES (?, ?, ?)
""")) {
statement.setInt(1, i);
statement.setLong(2, result.getCallsPerSecond().get(i));
statement.setString(3, result.getRunId());
statement.executeUpdate();
}

}

Expand Down

0 comments on commit 89658ec

Please sign in to comment.