Skip to content

Commit bc34e41

Browse files
Refactor tx_pool_latency_analysis and tx_pool_throughput_analysis to replace 'measureInterval' with 'logInterval' for consistency. Update related documentation and configuration files to reflect this change, and adjust TPS values in playbooks for improved testing scenarios.
1 parent 61f6609 commit bc34e41

File tree

9 files changed

+35
-35
lines changed

9 files changed

+35
-35
lines changed

pkg/coordinator/tasks/tx_pool_latency_analysis/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The `tx_pool_latency_analysis` task evaluates latency of transaction processing
1515
- **`duration_s`**:
1616
The test duration (the number of transactions to send is calculated as `tps * duration_s`).
1717

18-
- **`measureInterval`**:
18+
- **`logInterval`**:
1919
The interval at which the script logs progress (e.g., every 100 transactions).
2020

2121
### Outputs
@@ -37,9 +37,9 @@ The `tx_pool_latency_analysis` task evaluates latency of transaction processing
3737
```yaml
3838
- name: tx_pool_latency_analysis
3939
config:
40-
tps: 100
40+
tps: 1000
4141
duration_s: 10
42-
measureInterval: 1000
42+
logInterval: 1000
4343
configVars:
4444
privateKey: "walletPrivkey"
4545
```

pkg/coordinator/tasks/tx_pool_latency_analysis/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ type Config struct {
55

66
TPS int `yaml:"tps" json:"tps"`
77
Duration_s int `yaml:"duration_s" json:"duration_s"`
8-
MeasureInterval int `yaml:"measureInterval" json:"measureInterval"`
8+
LogInterval int `yaml:"logInterval" json:"logInterval"`
99
SecondsBeforeRunning int64 `yaml:"secondsBeforeRunning" json:"secondsBeforeRunning"`
1010
}
1111

1212
func DefaultConfig() Config {
1313
return Config{
1414
TPS: 100,
1515
Duration_s: 60,
16-
MeasureInterval: 100,
16+
LogInterval: 100,
1717
SecondsBeforeRunning: 0,
1818
}
1919
}

pkg/coordinator/tasks/tx_pool_latency_analysis/task.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func (t *Task) Execute(ctx context.Context) error {
113113
var testDeadline time.Time = time.Now().Add(time.Duration(t.config.Duration_s+60*30) * time.Second)
114114

115115
load_target := tx_load_tool.NewLoadTarget(ctx, t.ctx, t.logger, t.wallet, client)
116-
load := tx_load_tool.NewLoad(load_target, t.config.TPS, t.config.Duration_s, testDeadline)
116+
load := tx_load_tool.NewLoad(load_target, t.config.TPS, t.config.Duration_s, testDeadline, t.config.LogInterval)
117117

118118
// Generate and sending transactions, waiting for their propagation
119119
err = load.Execute()

pkg/coordinator/tasks/tx_pool_throughput_analysis/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The `tx_pool_throughput_analysis` task evaluates the throughput of transaction p
1515
- **`duration_s`**:
1616
The test duration (the number of transactions to send is calculated as `tps * duration_s`).
1717

18-
- **`measureInterval`**:
18+
- **`logInterval`**:
1919
The interval at which the script logs progress (e.g., every 100 transactions).
2020

2121
### Outputs
@@ -31,9 +31,9 @@ The `tx_pool_throughput_analysis` task evaluates the throughput of transaction p
3131
```yaml
3232
- name: tx_pool_throughput_analysis
3333
config:
34-
tps: 100
34+
tps: 1000
3535
duration_s: 10
36-
measureInterval: 1000
36+
logInterval: 1000
3737
configVars:
3838
privateKey: "walletPrivkey"
3939
```

pkg/coordinator/tasks/tx_pool_throughput_analysis/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ type Config struct {
55

66
TPS int `yaml:"tps" json:"tps"`
77
Duration_s int `yaml:"duration_s" json:"duration_s"`
8-
MeasureInterval int `yaml:"measureInterval" json:"measureInterval"`
8+
LogInterval int `yaml:"logInterval" json:"logInterval"`
99
SecondsBeforeRunning int `yaml:"secondsBeforeRunning" json:"secondsBeforeRunning"`
1010
}
1111

1212
func DefaultConfig() Config {
1313
return Config{
1414
TPS: 100,
1515
Duration_s: 60,
16-
MeasureInterval: 100,
16+
LogInterval: 100,
1717
SecondsBeforeRunning: 0,
1818
}
1919
}

pkg/coordinator/tasks/tx_pool_throughput_analysis/task.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func (t *Task) Execute(ctx context.Context) error {
112112
var testDeadline time.Time = time.Now().Add(time.Duration(t.config.Duration_s+60*30) * time.Second)
113113

114114
load_target := tx_load_tool.NewLoadTarget(ctx, t.ctx, t.logger, t.wallet, client)
115-
load := tx_load_tool.NewLoad(load_target, t.config.TPS, t.config.Duration_s, testDeadline)
115+
load := tx_load_tool.NewLoad(load_target, t.config.TPS, t.config.Duration_s, testDeadline, t.config.LogInterval)
116116

117117
// Generate and sending transactions, waiting for their propagation
118118
err = load.Execute()

pkg/coordinator/utils/tx_load_tool/tx_load_tool.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ import (
2020
"github.com/sirupsen/logrus"
2121
)
2222

23-
const logInterval = 100 // Log every 100 transactions
24-
2523
type LoadTarget struct {
2624
ctx context.Context
2725
task_ctx *types.TaskContext
@@ -73,21 +71,23 @@ func NewLoadResult(totNumberOfTxes int) *LoadResult {
7371
}
7472

7573
type Load struct {
76-
target *LoadTarget
77-
testDeadline time.Time
78-
TPS int
79-
Duration_s int
80-
Result *LoadResult
74+
target *LoadTarget
75+
testDeadline time.Time
76+
TPS int
77+
Duration_s int
78+
LogInterval int
79+
Result *LoadResult
8180
}
8281

8382
// NewLoad creates a new Load instance
84-
func NewLoad(target *LoadTarget, TPS int, duration_s int, testDeadline time.Time) *Load {
83+
func NewLoad(target *LoadTarget, TPS int, duration_s int, testDeadline time.Time, logInterval int) *Load {
8584
return &Load{
86-
target: target,
87-
TPS: TPS,
88-
Duration_s: duration_s,
89-
testDeadline: testDeadline,
90-
Result: NewLoadResult(TPS * duration_s),
85+
target: target,
86+
TPS: TPS,
87+
Duration_s: duration_s,
88+
testDeadline: testDeadline,
89+
LogInterval: logInterval,
90+
Result: NewLoadResult(TPS * duration_s),
9191
}
9292
}
9393

@@ -140,7 +140,7 @@ func (l *Load) Execute() error {
140140
l.Result.SentTxCount++
141141

142142
// log transaction sending
143-
if l.Result.SentTxCount%logInterval == 0 {
143+
if l.Result.SentTxCount%l.LogInterval == 0 {
144144
elapsed := time.Since(l.Result.StartTime)
145145
l.target.logger.Infof("Sent %d transactions in %.2fs", l.Result.SentTxCount, elapsed.Seconds())
146146
}
@@ -234,7 +234,7 @@ func (l *Load) MeasurePropagationLatencies() (*LoadResult, error) {
234234
receivedEvents++
235235
}
236236

237-
if receivedEvents%logInterval == 0 {
237+
if receivedEvents%l.LogInterval == 0 {
238238
l.target.logger.Infof("Received %d p2p events", receivedEvents)
239239
}
240240
}

playbooks/dev/tx-pool-check-short.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ tasks:
1111
config:
1212
tps: 1000
1313
duration_s: 10
14-
measureInterval: 1000
14+
logInterval: 1000
1515
configVars:
1616
privateKey: "walletPrivkey"
1717
- name: tx_pool_clean
@@ -25,6 +25,6 @@ tasks:
2525
config:
2626
tps: 1000
2727
duration_s: 10
28-
measureInterval: 1000
28+
logInterval: 1000
2929
configVars:
3030
privateKey: "walletPrivkey"

playbooks/dev/tx-pool-check.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ tasks:
1111
config:
1212
tps: 1000
1313
duration_s: 10
14-
measureInterval: 1000
14+
logInterval: 1000
1515
configVars:
1616
privateKey: "walletPrivkey"
1717
- name: tx_pool_clean
@@ -25,7 +25,7 @@ tasks:
2525
config:
2626
tps: 1000
2727
duration_s: 10
28-
measureInterval: 1000
28+
logInterval: 1000
2929
configVars:
3030
privateKey: "walletPrivkey"
3131
# - name: tx_pool_clean
@@ -38,7 +38,7 @@ tasks:
3838
# timeout: 10m
3939
# config:
4040
# txCount: 10000
41-
# measureInterval: 1000
41+
# logInterval: 1000
4242
# highLatency: 5000
4343
# failOnHighLatency: true
4444
# configVars:
@@ -53,7 +53,7 @@ tasks:
5353
# timeout: 10m
5454
# config:
5555
# qps: 10000
56-
# measureInterval: 1000
56+
# logInterval: 1000
5757
# configVars:
5858
# privateKey: "walletPrivkey"
5959
# - name: tx_pool_clean
@@ -66,7 +66,7 @@ tasks:
6666
# timeout: 30m
6767
# config:
6868
# txCount: 15000
69-
# measureInterval: 1500
69+
# logInterval: 1500
7070
# highLatency: 7000
7171
# failOnHighLatency: true
7272
# configVars:
@@ -81,6 +81,6 @@ tasks:
8181
# title: "Check transaction pool throughput with 15.000 transactions in one second"
8282
# config:
8383
# qps: 15000
84-
# measureInterval: 1500
84+
# logInterval: 1500
8585
# configVars:
8686
# privateKey: "walletPrivkey"

0 commit comments

Comments
 (0)