Skip to content

Commit

Permalink
Adding opensearch dashboards and index mapping.
Browse files Browse the repository at this point in the history
  • Loading branch information
jzonthemtn committed Nov 8, 2024
1 parent f28cbb7 commit 7d4eae4
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 1 deletion.
15 changes: 15 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
92 changes: 91 additions & 1 deletion run-and-index.sh
Original file line number Diff line number Diff line change
@@ -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 @-
5 changes: 5 additions & 0 deletions src/main/java/ai/philterd/phileas/benchmark/Result.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import java.util.UUID;

public class Result {

Expand All @@ -38,6 +39,9 @@ public class Result {
@SerializedName("calls_per_sec")
private Map<Integer, Long> callsPerSecond;

@SerializedName("run_id")
private String runId;

private long timestamp;

public Result() throws IOException {
Expand All @@ -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() {
Expand Down

0 comments on commit 7d4eae4

Please sign in to comment.