Skip to content

Commit

Permalink
cmd/seb read: add spacing to output
Browse files Browse the repository at this point in the history
  • Loading branch information
micvbang committed Jul 16, 2024
1 parent 8ddb415 commit 998db82
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions cmd/seb/app/dump.go → cmd/seb/app/read.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,18 @@ var dumpCmd = &cobra.Command{
}

fmt.Printf("Seb file '%s'\n", absInputPath)
fmt.Printf("Version: %v\n", p.Header.Version)
fmt.Printf("Magic bytes: %v\n", sebrecords.FileFormatMagicBytes == p.Header.MagicBytes)
fmt.Printf("NumRecords: %d\n", p.Header.NumRecords)
fmt.Printf("Timestamp: %s\n", time.UnixMicro(p.Header.UnixEpochUs))
fmt.Printf("Version:\t\t%v\n", p.Header.Version)
fmt.Printf("Magic bytes:\t\t%v\n", sebrecords.FileFormatMagicBytes == p.Header.MagicBytes)
fmt.Printf("NumRecords:\t\t%d\n", p.Header.NumRecords)
fmt.Printf("Timestamp:\t\t%s\n", time.UnixMicro(p.Header.UnixEpochUs))

fileSize := fi.Size()
headerSize := p.Header.Size()
dataSize := fileSize - int64(headerSize)
fmt.Printf("Total file size: %v (%v B)\n", sizey.FormatBytes(fileSize), fileSize)
fmt.Printf("Header size: %v (%d B)\n", sizey.FormatBytes(headerSize), headerSize)
fmt.Printf("Data size: %v (%d B)\n", sizey.FormatBytes(dataSize), dataSize)
records, err := p.Records(0, p.Header.NumRecords)
fmt.Printf("Total file size:\t%v (%v B)\n", sizey.FormatBytes(fileSize), fileSize)
fmt.Printf("Header size:\t\t%v (%d B)\n", sizey.FormatBytes(headerSize), headerSize)
fmt.Printf("Data size: %v\t(%d B)\n", sizey.FormatBytes(dataSize), dataSize)
batch, err := p.Records(0, p.Header.NumRecords)
if err != nil {
return fmt.Errorf("reading records: %w", err)
}
Expand Down

0 comments on commit 998db82

Please sign in to comment.