-
Notifications
You must be signed in to change notification settings - Fork 494
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
tools: block generator #5245
tools: block generator #5245
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5245 +/- ##
==========================================
+ Coverage 53.52% 53.59% +0.06%
==========================================
Files 441 446 +5
Lines 55140 55633 +493
==========================================
+ Hits 29513 29814 +301
- Misses 23339 23515 +176
- Partials 2288 2304 +16
... and 12 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@@ -68,3 +68,6 @@ index.html | |||
|
|||
# test summary | |||
testresults.json | |||
|
|||
# block generator binary | |||
tools/block-generator/block-generator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added this to gitignore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should merge as-is since the build is passing, and for the most part this is a straight port from the original. So I haven't gone through every bit of the logic--we can continue updating/changing that as needed when we start working on the logic updates we need.
Handler: mux, | ||
Addr: addr, | ||
Handler: mux, | ||
ReadHeaderTimeout: 3 * time.Second, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any recovery in case of timeout? Or that will end up killing the run?
@@ -90,7 +90,7 @@ func (r *Args) run() error { | |||
} | |||
|
|||
// This middleware allows us to lock the block endpoint | |||
var freezeMutex sync.Mutex | |||
var freezeMutex deadlock.Mutex |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious to understand the benefits of deadlock
's Mutex over sync
's in this context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it's just for the deadlock detection feature, you can see it configured here: https://github.com/algorand/go-algorand/blob/master/cmd/algod/main.go#L269
if err != nil { | ||
return | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This segment seems redundant as err is now set and return is happening immediately after.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(not clear in this context, I'm referring to lines 36-38)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically appprovable, but I left a couple of questions.
@@ -0,0 +1,115 @@ | |||
# Block Generator | |||
|
|||
This tool is used for testing Indexer import performance. It does this by generating synthetic blocks which are sent by mocking the Algod REST API endpoints that Indexer uses. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This tool is used for testing Indexer import performance. It does this by generating synthetic blocks which are sent by mocking the Algod REST API endpoints that Indexer uses. | |
This tool is used for testing Conduit import performance. It does this by generating synthetic blocks which are sent by mocking the Algod REST API endpoints that Indexer uses. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's save these for the next PR
adding block generator to
/tools
. the code is copied from an internal tools repo. Some fixes were needed to pass the CI.