summaryrefslogtreecommitdiff
path: root/tableStats.go
diff options
context:
space:
mode:
Diffstat (limited to 'tableStats.go')
-rw-r--r--tableStats.go17
1 files changed, 15 insertions, 2 deletions
diff --git a/tableStats.go b/tableStats.go
index ba45e31..0a278e0 100644
--- a/tableStats.go
+++ b/tableStats.go
@@ -3,15 +3,24 @@
package gitpb
import (
- "go.wit.com/log"
"go.wit.com/lib/cobol"
+ "go.wit.com/log"
)
func (pb *Stats) PrintTable() string {
t := pb.MakeTable("missing repos table")
+ // limit the number of lines
t.PrintTable()
- return log.Sprintf("pb.StatsTB: total=(%d)", pb.Len())
+ return log.Sprintf("pb.StatsTB: top 16 refs total=(%d)", pb.Len())
+}
+
+func (pb *Stats) PrintTableLimit(limit int) string {
+ t := pb.MakeTable("missing repos table")
+
+ // limit the number of lines
+ t.PrintTableLimit(limit)
+ return log.Sprintf("pb.StatsTB: top %d refs total=(%d)", limit, pb.Len())
}
func (pb *Stats) MakeTable(name string) *StatsTable {
@@ -23,6 +32,10 @@ func (pb *Stats) MakeTable(name string) *StatsTable {
col = t.AddPatchId()
col.Width = 10
+ col = t.AddHash()
+ col.Width = 10
+ col.Header.Name = "Git Hash"
+
col = t.AddStringFunc("something", func(r *Stat) string {
return "notsure"
})