Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions chunk.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ func (cc *commPCallback) OnSuccess(buf *Buffer, graphName, payloadCid, fsDetail
carFilePath := filepath.Join(cc.carDir, cpRes.Root.String())
carFileNameWithSuffix := carFilePath + ".car"

log.Infof("start write car to tile")
writeStart := time.Now()
carFile, err := os.OpenFile(carFileNameWithSuffix, os.O_RDWR|os.O_CREATE, 0o644)
if err != nil {
log.Fatalf("failed to create car file: %s", err)
Expand All @@ -52,6 +54,7 @@ func (cc *commPCallback) OnSuccess(buf *Buffer, graphName, payloadCid, fsDetail
}
buf.Reset()
carFile.Close()
log.Infof("end write car to file: %v", time.Since(writeStart))

if cc.rename {
if err := os.Rename(carFileNameWithSuffix, carFilePath); err != nil {
Expand Down
4 changes: 4 additions & 0 deletions utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ func BuildIpldGraph(ctx context.Context,
graphName string,
params *ChunkParams,
) {
start := time.Now()
defer func() {
log.Infof("BuildIpldGraph took: %v", time.Since(start))
}()
buf, payloadCid, fsDetail, err := buildIpldGraph(ctx, fileList, params.ParentPath, params.Parallel,
params.ExpectSliceSize, params.Ef, params.SkipFilename)
if err != nil {
Expand Down