Skip to content

Commit

Permalink
Merge pull request #4328 from vespa-engine/bjorncs/stabilize
Browse files Browse the repository at this point in the history
Only include if non-null MERGEOK
  • Loading branch information
bjorncs authored Jan 30, 2025
2 parents ee5dc5a + 5271117 commit cea5d91
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
6 changes: 4 additions & 2 deletions lib/performance_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,10 @@ def fill_feeder_json(json)
result.add_metric('feeder.minlatency', json['http.response.latency.millis.min'].to_s)
result.add_metric('feeder.maxlatency', json['http.response.latency.millis.max'].to_s)
result.add_metric('feeder.avglatency', json['http.response.latency.millis.avg'].to_s)
result.add_metric("feeder.operation.avg_latency", json.dig("operation.latency", "avg").to_s)
result.add_metric('feeder.response.200.avg_latency', json.dig("http.response", "200", "latency", "avg").to_s)
operation_latency = json.dig("operation.latency", "avg")
result.add_metric("feeder.operation.avg_latency", operation_latency.to_s) if operation_latency
response_200_latency = json.dig("http.response", "200", "latency", "avg")
result.add_metric('feeder.response.200.avg_latency', response_200_latency.to_s) if response_200_latency
result.add_parameter('loadgiver', 'vespa-feed-client')
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ static void printJsonReport(Duration duration, OperationStats stats, String load
generator.writeStartObject();
generator.writeNumberField("feeder.runtime", duration.toMillis());
generator.writeNumberField("feeder.okcount", stats.successes());
generator.writeNumberField("feeder.errorcount", stats.exceptions() + stats.responsesByCode().entrySet().stream().filter(entry -> entry.getKey() != 200).map(Entry::getValue).reduce(0L, Long::sum));
generator.writeNumberField("feeder.errorcount", stats.exceptions() + stats.statsByCode().entrySet().stream()
.filter(entry -> entry.getKey() != 200)
.map(e -> e.getValue().count())
.reduce(0L, Long::sum));
generator.writeNumberField("feeder.exceptions", stats.exceptions());
generator.writeNumberField("feeder.bytessent", stats.bytesSent());
generator.writeNumberField("feeder.bytesreceived", stats.bytesReceived());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ public static void main(String[] args) throws IOException {
FeedClient client = createFeedClient();
AtomicReference<OperationStats> stats = new AtomicReference<>();
ScheduledExecutorService executor = Executors.newScheduledThreadPool(1);
executor.schedule(() -> { stats.set(client.stats()); },
warmupSeconds(), TimeUnit.SECONDS);
executor.schedule(() -> { stats.set(client.stats().since(stats.get())); executor.shutdown(); },
executor.schedule(client::resetStats, warmupSeconds(), TimeUnit.SECONDS);
executor.schedule(() -> { stats.set(client.stats()); executor.shutdown(); },
warmupSeconds() + benchmarkSeconds(), TimeUnit.SECONDS);
executor.scheduleAtFixedRate(() -> { System.err.println(client.stats()); },
1, 1, TimeUnit.SECONDS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static void main(String[] args) throws IOException {
AtomicReference<OperationStats> stats = new AtomicReference<>();
AtomicLong startNanos = new AtomicLong();
ScheduledExecutorService executor = Executors.newScheduledThreadPool(1);
executor.schedule(() -> { stats.set(client.stats()); startNanos.set(System.nanoTime()); },
executor.schedule(() -> { client.resetStats(); startNanos.set(System.nanoTime()); },
warmupSeconds(), TimeUnit.SECONDS);
executor.scheduleAtFixedRate(() -> { System.err.println(client.stats()); },
1, 1, TimeUnit.SECONDS);
Expand All @@ -55,7 +55,7 @@ public static void main(String[] args) throws IOException {
JsonFeeder feeder = JsonFeeder.builder(client).withRoute(route()).build()) {
feeder.feedMany(in);
}
printJsonReport(Duration.ofNanos(System.nanoTime() - startNanos.get()), client.stats().since(stats.get()), "vespa-json-feeder");
printJsonReport(Duration.ofNanos(System.nanoTime() - startNanos.get()), client.stats(), "vespa-json-feeder");
executor.shutdown();
}

Expand Down

0 comments on commit cea5d91

Please sign in to comment.