Extend the load report tool to include transactions' hashes (backport #9509) (#9514)

* Extend the load report tool to include transactions' hashes (#9509)

* Add transaction hash to raw data

* Add hash in formatted output

* Cosmetic

(cherry picked from commit cdd3479f20)

# Conflicts:
#	test/loadtime/cmd/report/main.go

* Resolve conflict

* Appease linter

Co-authored-by: Sergio Mena <sergio@informal.systems>
This commit is contained in:
mergify[bot]
2022-10-05 21:56:34 +02:00
committed by GitHub
co-authored by Sergio Mena
parent bda1dd4734
commit df5ba80914
2 changed files with 9 additions and 6 deletions
+2 -2
View File
@@ -87,7 +87,7 @@ func toCSVRecords(rs []report.Report) [][]string {
}
res := make([][]string, total+1)
res[0] = []string{"experiment_id", "duration_ns", "block_time", "connections", "rate", "size"}
res[0] = []string{"experiment_id", "block_time", "duration_ns", "tx_hash", "connections", "rate", "size"}
offset := 1
for _, r := range rs {
idStr := r.ID.String()
@@ -95,7 +95,7 @@ func toCSVRecords(rs []report.Report) [][]string {
rateStr := strconv.FormatInt(int64(r.Rate), 10)
sizeStr := strconv.FormatInt(int64(r.Size), 10)
for i, v := range r.All {
res[offset+i] = []string{idStr, strconv.FormatInt(int64(v.Duration), 10), strconv.FormatInt(v.BlockTime.UnixNano(), 10), connStr, rateStr, sizeStr} //nolint: lll
res[offset+i] = []string{idStr, strconv.FormatInt(v.BlockTime.UnixNano(), 10), strconv.FormatInt(int64(v.Duration), 10), fmt.Sprintf("%X", v.Hash), connStr, rateStr, sizeStr} //nolint: lll
}
offset += len(r.All)
}