Skip to content

Commit

Permalink
Matching simulation with more read partitions than write partitions (u…
Browse files Browse the repository at this point in the history
  • Loading branch information
taylanisikdemir authored Aug 15, 2024
1 parent f591d95 commit c903543
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 5 deletions.
2 changes: 1 addition & 1 deletion host/matching_simulation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ type operationAggStats struct {
func TestMatchingSimulationSuite(t *testing.T) {
flag.Parse()

confPath := os.Getenv("MATCHING_SIMULATION_CASE")
confPath := os.Getenv("MATCHING_SIMULATION_CONFIG")
if confPath == "" {
confPath = defaultTestCase
}
Expand Down
25 changes: 25 additions & 0 deletions host/testdata/matching_simulation_more_read_partitions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
enablearchival: false
clusterno: 1
messagingclientconfig:
usemock: true
historyconfig:
numhistoryshards: 4
numhistoryhosts: 1
matchingconfig:
nummatchinghosts: 4
simulationconfig:
tasklistwritepartitions: 2
tasklistreadpartitions: 4
numpollers: 10
numtaskgenerators: 2
taskspersecond: 40
maxtasktogenerate: 1500
polltimeout: 60s
forwardermaxoutstandingpolls: 1
forwardermaxoutstandingtasks: 1
forwardermaxratepersecond: 10
forwardermaxchildrenpernode: 20
localpollwaittime: 0ms
localtaskwaittime: 0ms
workerconfig:
enableasyncwfconsumer: false
9 changes: 5 additions & 4 deletions scripts/run_matching_simulator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,23 @@

set -eo pipefail

testName="test-$(date '+%Y-%m-%d-%H-%M-%S')"
testCase="${1:-default}"
testCfg="testdata/matching_simulation_$testCase.yaml"
testName="test-$testCase-$(date '+%Y-%m-%d-%H-%M-%S')"
resultFolder="matching-simulator-output"
mkdir -p "$resultFolder"
eventLogsFile="$resultFolder/events.json"
testSummaryFile="$resultFolder/$testName-summary.txt"
testCase="testdata/matching_simulation_${1:-default}.yaml"


echo "Building test image"
docker-compose -f docker/buildkite/docker-compose-local-matching-simulation.yml \
build matching-simulator

echo "Running the test"
echo "Running the test $testCase"
docker-compose \
-f docker/buildkite/docker-compose-local-matching-simulation.yml \
run -e MATCHING_SIMULATION_CASE=$testCase --rm matching-simulator \
run -e MATCHING_SIMULATION_CONFIG=$testCfg --rm matching-simulator \
| grep -a --line-buffered "Matching New Event" \
| sed "s/Matching New Event: //" \
| jq . > "$eventLogsFile"
Expand Down

0 comments on commit c903543

Please sign in to comment.