-
Notifications
You must be signed in to change notification settings - Fork 453
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 standalone coordinator benchmarker #654
Conversation
8a16c41
to
b59dc2d
Compare
Codecov Report
@@ Coverage Diff @@
## master #654 +/- ##
==========================================
+ Coverage 80.78% 81.29% +0.51%
==========================================
Files 277 276 -1
Lines 24953 24599 -354
==========================================
- Hits 20158 19998 -160
+ Misses 3601 3406 -195
- Partials 1194 1195 +1
Continue to review full report at Codecov.
|
scanner := bufio.NewScanner(inFile) | ||
for w := 0; w < workers; w++ { | ||
for b := 0; b < batchFiles; b++ { | ||
outFilePath := fmt.Sprintf("%s/%s%d_%d", dir, toFile, w, b) |
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.
nit: You can use path.Join
instead of encoding "/" in the path.
Timeseries: ts, | ||
} | ||
data, _ := proto.Marshal(req) | ||
return string(snappy.Encode(nil, data)) |
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.
Probably best to return []byte and outFile.Write(bytes) instead to avoid the large string alloc?
|
||
func main() { | ||
if cardinality { | ||
fmt.Println("Calculating cardinality only") |
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.
Might be best to use loggers everywhere? shrug.
} | ||
|
||
start := time.Now() | ||
log.Println("Started benchmark at:", start.Format(time.StampMilli)) |
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.
Maybe print out how many is going to be written too?
go func() { | ||
defer wg.Done() | ||
for batchNumber := 0; batchNumber < batches; batchNumber++ { | ||
err = writeToCoordinator(fmt.Sprintf("%s/%s%d_%d", dataDir, dataFile, worker, batchNumber)) |
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.
nit: Can use path.Join
here too.
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.
LGTM once build is passing
No description provided.