-
Notifications
You must be signed in to change notification settings - Fork 829
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add command to loadtest against RPC endpoints #2072
base: main
Are you sure you want to change the base?
Conversation
634c3c8
to
ac186f9
Compare
cmd/seid/cmd/evmrpcload.go
Outdated
go func() { | ||
defer wg.Done() | ||
for { | ||
select { | ||
case <-ctx.Done(): | ||
return | ||
default: | ||
var res interface{} | ||
now := time.Now() | ||
if err := rpcclient.CallContext(ctx, &res, load.Method, typedParams...); err != nil { | ||
if !strings.Contains(err.Error(), "context deadline exceeded") { | ||
fmt.Printf("calling %s encountered error %s\n", load.Method, err) | ||
} | ||
return | ||
} | ||
callCounts[i].Add(1) | ||
latencies[i].Add(time.Since(now).Microseconds()) | ||
serializedRes, _ := json.Marshal(res) | ||
if load.ExpectedResult != "" && string(serializedRes) != load.ExpectedResult { | ||
fmt.Printf("calling %s expected %s but got %s\n", load.Method, load.ExpectedResult, string(serializedRes)) | ||
return | ||
} | ||
} | ||
} | ||
}() |
Check notice
Code scanning / CodeQL
Spawning a Go routine Note
return | ||
default: | ||
var res interface{} | ||
now := time.Now() |
Check warning
Code scanning / CodeQL
Calling the system time Warning
c884450
to
611047f
Compare
Codecov ReportAttention: Patch coverage is
❌ Your project check has failed because the head coverage (58.37%) is below the target coverage (60.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #2072 +/- ##
==========================================
- Coverage 61.41% 58.37% -3.04%
==========================================
Files 264 274 +10
Lines 24647 26143 +1496
==========================================
+ Hits 15136 15261 +125
- Misses 8383 9748 +1365
- Partials 1128 1134 +6
|
611047f
to
c7eefa6
Compare
Describe your changes and provide context
Usage:
Example config is included in this commit.
Testing performed to validate your change
local sei test
seid evm-rpc-load --config=cmd/seid/cmd/config/rpc_load.json made 2272476 requests for load 0 with an average latency of 131 micro seconds
unit tests