diff --git a/docker-compose.yaml b/docker-compose.yaml index 9469df3..ea2d80b 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -15,6 +15,21 @@ services: networks: - opensearch + dashboards: + image: opensearchproject/opensearch-dashboards:2.18.0 + container_name: dashboards + ports: + - 5601:5601 + expose: + - 5601 + environment: + OPENSEARCH_HOSTS: '["http://opensearch:9200"]' + DISABLE_SECURITY_DASHBOARDS_PLUGIN: "true" + depends_on: + - opensearch + networks: + - opensearch + networks: opensearch: driver: bridge diff --git a/run-and-index.sh b/run-and-index.sh index fa3c4e5..67811ce 100755 --- a/run-and-index.sh +++ b/run-and-index.sh @@ -1,5 +1,95 @@ #!/bin/bash -e -java -server -Xmx512M -XX:+AlwaysPreTouch -XX:PerBytecodeRecompilationCutoff=10000 -XX:PerMethodRecompilationCutoff=10000 -jar target/phileas-benchmark-cmd.jar all mask_all 1 15000 json > tests.jsonl +java -server -Xmx512M -XX:+AlwaysPreTouch -XX:PerBytecodeRecompilationCutoff=10000 -XX:PerMethodRecompilationCutoff=10000 -jar target/phileas-benchmark-cmd.jar all mask_all 1 100 json > tests.jsonl + +curl -X DELETE http://localhost:9200/phileas_benchmarks + +curl -X PUT http://localhost:9200/phileas_benchmarks -H "Content-Type: application/json" -d'{ + "mappings": { + "properties": { + "calls_per_sec": { + "properties": { + "0": { + "type": "long" + }, + "1": { + "type": "long" + }, + "1024": { + "type": "long" + }, + "128": { + "type": "long" + }, + "1280": { + "type": "long" + }, + "1536": { + "type": "long" + }, + "16": { + "type": "long" + }, + "1792": { + "type": "long" + }, + "2": { + "type": "long" + }, + "2048": { + "type": "long" + }, + "256": { + "type": "long" + }, + "3072": { + "type": "long" + }, + "32": { + "type": "long" + }, + "4": { + "type": "long" + }, + "4096": { + "type": "long" + }, + "512": { + "type": "long" + }, + "64": { + "type": "long" + }, + "768": { + "type": "long" + }, + "8": { + "type": "long" + } + } + }, + "run_id": { + "type": "keyword" + }, + "document": { + "type": "keyword" + }, + "phileas_version": { + "type": "keyword" + }, + "redactor": { + "type": "keyword" + }, + "timestamp": { + "type" : "date", + "format" : "epoch_millis" + }, + "workload_millis": { + "type": "long" + } + } + } + } +}' cat tests.jsonl | jq -c '. | {"index": {"_index": "phileas_benchmarks"}}, .' | curl -H "Content-Type: application/json" -XPOST localhost:9200/_bulk --data-binary @- diff --git a/src/main/java/ai/philterd/phileas/benchmark/Result.java b/src/main/java/ai/philterd/phileas/benchmark/Result.java index b2952ab..d050e26 100644 --- a/src/main/java/ai/philterd/phileas/benchmark/Result.java +++ b/src/main/java/ai/philterd/phileas/benchmark/Result.java @@ -23,6 +23,7 @@ import java.util.HashMap; import java.util.Map; import java.util.Properties; +import java.util.UUID; public class Result { @@ -38,6 +39,9 @@ public class Result { @SerializedName("calls_per_sec") private Map callsPerSecond; + @SerializedName("run_id") + private String runId; + private long timestamp; public Result() throws IOException { @@ -49,6 +53,7 @@ public Result() throws IOException { this.phileasVersion = p.getProperty("phileas.version"); this.timestamp = System.currentTimeMillis(); + this.runId = UUID.randomUUID().toString(); } public String getDocument() {