-
Notifications
You must be signed in to change notification settings - Fork 826
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.36%) 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.69% 58.36% -3.33%
==========================================
Files 265 275 +10
Lines 24690 26191 +1501
==========================================
+ Hits 15232 15287 +55
- Misses 8326 9772 +1446
Partials 1132 1132
|
611047f
to
c7eefa6
Compare
c7eefa6
to
0f3eec8
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