Skip to content

Commit

Permalink
Merge pull request #225 from xtuml/224_jm_aeo_race
Browse files Browse the repository at this point in the history
job:  #224  fix bug in JM/AEO bring-up
  • Loading branch information
cortlandstarrett authored Jun 11, 2024
2 parents a1ac3ae + 3db71f7 commit 1a47173
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
16 changes: 11 additions & 5 deletions metrics/run_benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,13 @@ echo "0 of " $TOTAL_EVENTS
LOOP_COUNT=0
for ((i = 0; i < $ITERATIONS; i++)); do
echo ${puml_files} | xargs $P2J --play --msgbroker localhost:9092 --topic $RECEPTION_TOPIC --shuffle --rate $EVENTS_PER_SECOND --num-events $BATCH_OF_EVENTS
# Inject an error to fail one job.
echo "Inject error to fail a job."
$P2J ${puml_file_for_injection} --play --msgbroker localhost:9092 --topic $RECEPTION_TOPIC --omit C
echo "Inject error to alarm a job."
$P2J ${puml_file_for_alarm} --play --msgbroker localhost:9092 --topic $RECEPTION_TOPIC --sibling CSJC
if [[ $# -lt 3 ]] ; then
# Inject an error to fail one job.
echo "Inject error to fail a job."
$P2J ${puml_file_for_injection} --play --msgbroker localhost:9092 --topic $RECEPTION_TOPIC --omit C
echo "Inject error to alarm a job."
$P2J ${puml_file_for_alarm} --play --msgbroker localhost:9092 --topic $RECEPTION_TOPIC --sibling CSJC
fi
LOOP_COUNT=$(($LOOP_COUNT + 1))
echo $(($LOOP_COUNT * $BATCH_OF_EVENTS)) " of " $TOTAL_EVENTS
done
Expand All @@ -109,6 +111,10 @@ events_per_second=$(($TOTAL_EVENTS / $runtime))
echo $runtime "seconds at rate:" $events_per_second >> runtime.txt
sleep 20
echo "Done."
if [[ $# -ge 3 ]] ; then
echo "Press ENTER to continue..."
read a
fi

# run the benchmark script
echo "Running benchmark calculations..."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ state AEOrdering::Worker.Registered () is
begin
cancel this.workerTimer;
this.registered := true;
schedule this.workerTimer generate Worker.reportHeartbeat() to this delay this.heartbeatRate;
schedule this.workerTimer generate Worker.reportHeartbeat() to this delay @PT0S@;
end state;
//! ACTIVITY END. DO NOT EDIT THIS LINE.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ begin
while noWorkersAvailable = false loop
// check worker capacity
employedWorker := nextWorker -> R2.EmployedWorker;
if employedWorker /= null and (employedWorker -> R6.AssignedJob)'length < jmSpec.maxJobsPerWorker then
if employedWorker /= null and employedWorker.working and (employedWorker -> R6.AssignedJob)'length < jmSpec.maxJobsPerWorker then

// set up the next worker to be assigned
unlink this R4;
Expand Down

0 comments on commit 1a47173

Please sign in to comment.