Skip to content

Commit

Permalink
add tx count
Browse files Browse the repository at this point in the history
  • Loading branch information
welkin22 committed Oct 30, 2024
1 parent 27a8096 commit c8dd01a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/txdag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ type oneLine struct {
depList [][]uint64
flags []uint8
emptyDepRate float64
totalTxCount int
txLevelLength int
txLevelDetail levelDetails
}
Expand All @@ -77,6 +78,7 @@ func (l *oneLine) toCsvStringList() []string {
result = append(result, fmt.Sprintf("%v", l.depList))
result = append(result, fmt.Sprintf("%v", l.flags))
result = append(result, fmt.Sprintf("%.4f", l.emptyDepRate))
result = append(result, fmt.Sprintf("%v", l.totalTxCount))
result = append(result, fmt.Sprintf("%v", l.txLevelLength))
result = append(result, fmt.Sprintf("%v", l.txLevelDetail))
return result
Expand Down Expand Up @@ -106,7 +108,7 @@ func (l *levelDetail) String() string {

func scanAndOutput(scanner *bufio.Scanner, writer *csv.Writer, toBlock uint64) error {
defer writer.Flush()
err := writer.Write([]string{"block", "depList", "flags", "emptyDepRate", "txLevelLength", "txLevelDetail"})
err := writer.Write([]string{"block", "depList", "flags", "emptyDepRate", "totalTxCount", "txLevelLength", "txLevelDetail"})
if err != nil {
return err
}
Expand Down Expand Up @@ -162,6 +164,7 @@ func dagToCSVOneLine(number uint64, dag types.TxDAG) *oneLine {
depList: depList,
flags: flags,
emptyDepRate: float64(emptyDepCount) / float64(dag.TxCount()),
totalTxCount: dag.TxCount(),
txLevelLength: len(txLevels),
txLevelDetail: txLevelDetail,
}
Expand Down

0 comments on commit c8dd01a

Please sign in to comment.