diff --git a/test/loadtime/cmd/report/main.go b/test/loadtime/cmd/report/main.go index bd68a26757b..b92bf0ef5b3 100644 --- a/test/loadtime/cmd/report/main.go +++ b/test/loadtime/cmd/report/main.go @@ -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} + 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} } offset += len(r.All) } diff --git a/test/loadtime/report/report.go b/test/loadtime/report/report.go index 831b23a5719..269f63b2de8 100644 --- a/test/loadtime/report/report.go +++ b/test/loadtime/report/report.go @@ -25,6 +25,7 @@ type BlockStore interface { type DataPoint struct { Duration time.Duration BlockTime time.Time + Hash []byte } // Report contains the data calculated from reading the timestamped transactions @@ -68,7 +69,7 @@ func (rs *Reports) ErrorCount() int { return rs.errorCount } -func (rs *Reports) addDataPoint(id uuid.UUID, l time.Duration, bt time.Time, conns, rate, size uint64) { +func (rs *Reports) addDataPoint(id uuid.UUID, l time.Duration, bt time.Time, hash []byte, conns, rate, size uint64) { r, ok := rs.s[id] if !ok { r = Report{ @@ -81,7 +82,7 @@ func (rs *Reports) addDataPoint(id uuid.UUID, l time.Duration, bt time.Time, con } rs.s[id] = r } - r.All = append(r.All, DataPoint{Duration: l, BlockTime: bt}) + r.All = append(r.All, DataPoint{Duration: l, BlockTime: bt, Hash: hash}) if l > r.Max { r.Max = l } @@ -123,11 +124,12 @@ func GenerateFromBlockStore(s BlockStore) (*Reports, error) { id uuid.UUID l time.Duration bt time.Time + hash []byte connections, rate, size uint64 err error } type txData struct { - tx []byte + tx types.Tx bt time.Time } reports := &Reports{ @@ -161,6 +163,7 @@ func GenerateFromBlockStore(s BlockStore) (*Reports, error) { pdc <- payloadData{ l: l, bt: b.bt, + hash: b.tx.Hash(), id: uuid.UUID(*idb), connections: p.Connections, rate: p.Rate, @@ -202,7 +205,7 @@ func GenerateFromBlockStore(s BlockStore) (*Reports, error) { reports.addError() continue } - reports.addDataPoint(pd.id, pd.l, pd.bt, pd.connections, pd.rate, pd.size) + reports.addDataPoint(pd.id, pd.l, pd.bt, pd.hash, pd.connections, pd.rate, pd.size) } reports.calculateAll() return reports, nil