mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-08 22:23:11 +00:00
add basic report main
This commit is contained in:
30
test/loadtime/cmd/report/main.go
Normal file
30
test/loadtime/cmd/report/main.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math"
|
||||
"time"
|
||||
|
||||
"github.com/tendermint/tendermint/store"
|
||||
"github.com/tendermint/tendermint/test/loadtime/report"
|
||||
dbm "github.com/tendermint/tm-db"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// parse out the db location
|
||||
db, err := dbm.NewDB("blockstore", dbm.GoLevelDBBackend, "/home/william/.tendermint/data")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
s := store.NewBlockStore(db)
|
||||
r, err := report.GenerateFromBlockStore(s)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fmt.Println(r.ErrorCount)
|
||||
fmt.Println(len(r.All))
|
||||
fmt.Println(r.Min)
|
||||
fmt.Println(r.Max)
|
||||
fmt.Println(r.Avg)
|
||||
fmt.Println(int64(time.Duration(math.MaxInt64) / (2 * time.Second)))
|
||||
}
|
||||
Reference in New Issue
Block a user