Skip to content

Commit 3968f6f

Browse files
author
“Kevin”
committed
Change workflowDelay and batchDelay config from seconds to ms
1 parent da7afbe commit 3968f6f

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

cmd/samples/advanced/autoscaling-monitoring/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ autoscaling:
8080
loadGeneration:
8181
# Workflow-level settings
8282
workflows: 3 # Number of workflows to start
83-
workflowDelay: 2 # Delay between starting workflows (seconds)
83+
workflowDelay: 1000 # Delay between starting workflows (milliseconds)
8484

8585
# Activity-level settings (per workflow)
8686
activitiesPerWorkflow: 40 # Number of activities per workflow
87-
batchDelay: 2 # Delay between activity batches within workflow (seconds)
87+
batchDelay: 2000 # Delay between activity batches within workflow (milliseconds)
8888

8989
# Activity processing time range (milliseconds)
9090
minProcessingTime: 1000
@@ -124,9 +124,9 @@ autoscaling:
124124
pollerInitCount: 4
125125
loadGeneration:
126126
workflows: 3
127-
workflowDelay: 2
127+
workflowDelay: 1000
128128
activitiesPerWorkflow: 40
129-
batchDelay: 2
129+
batchDelay: 2000
130130
minProcessingTime: 1000
131131
maxProcessingTime: 6000
132132
```
@@ -139,10 +139,10 @@ The sample supports various load patterns for testing autoscaling behavior:
139139
```yaml
140140
loadGeneration:
141141
workflows: 3
142-
workflowDelay: 2
142+
workflowDelay: 1000
143143
activitiesPerWorkflow: 40
144144
```
145-
**Result**: 3 workflows starting 2 seconds apart, each with 40 activities (120 total activities)
145+
**Result**: 3 workflows starting 1 second apart, each with 40 activities (120 total activities)
146146

147147
#### **2. Burst Load**
148148
```yaml
@@ -157,7 +157,7 @@ loadGeneration:
157157
```yaml
158158
loadGeneration:
159159
workflows: 5
160-
workflowDelay: 5
160+
workflowDelay: 5000
161161
activitiesPerWorkflow: 100
162162
```
163163
**Result**: 5 long-running workflows with 5-second delays between starts (500 total activities)

cmd/samples/advanced/autoscaling-monitoring/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ const (
5757
DefaultPollerInitCount = 4
5858

5959
DefaultWorkflows = 3
60-
DefaultWorkflowDelay = 2
60+
DefaultWorkflowDelay = 1000
6161
DefaultActivitiesPerWorkflow = 40
62-
DefaultBatchDelay = 2
62+
DefaultBatchDelay = 2000
6363
DefaultMinProcessingTime = 1000
6464
DefaultMaxProcessingTime = 6000
6565
)

cmd/samples/advanced/autoscaling-monitoring/config/autoscaling.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ autoscaling:
1919
loadGeneration:
2020
# Workflow-level settings
2121
workflows: 3 # Number of workflows to start
22-
workflowDelay: 2 # Delay between starting workflows (seconds)
22+
workflowDelay: 400 # Delay between starting workflows (milliseconds)
2323

2424
# Activity-level settings (per workflow)
2525
activitiesPerWorkflow: 40 # Number of activities per workflow
26-
batchDelay: 2 # Delay between activity batches within workflow (seconds)
26+
batchDelay: 750 # Delay between activity batches within workflow (milliseconds)
2727

2828
# Activity processing time range (milliseconds)
2929
minProcessingTime: 1000

cmd/samples/advanced/autoscaling-monitoring/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ func startWorkflow(h *common.SampleHelper, config *AutoscalingConfiguration) {
136136

137137
// Add delay between workflows (except for the last one)
138138
if i < workflows-1 {
139-
time.Sleep(time.Duration(workflowDelay) * time.Second)
139+
time.Sleep(time.Duration(workflowDelay) * time.Millisecond)
140140
}
141141
}
142142

cmd/samples/advanced/autoscaling-monitoring/workflow.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ func AutoscalingWorkflow(ctx workflow.Context, activitiesPerWorkflow int, batchD
3434

3535
// Add some delay between batches to simulate real-world patterns
3636
// Use batch delay from configuration
37-
if i > 0 && i%10 == 0 {
38-
workflow.Sleep(ctx, time.Duration(batchDelay)*time.Second)
37+
if i > 0 && i % 10 == 0 {
38+
workflow.Sleep(ctx, time.Duration(batchDelay)*time.Millisecond)
3939
}
4040
}
4141

0 commit comments

Comments
 (0)