mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 18:02:24 +00:00
make ExecStats non-public
This commit is contained in:
parent
fedbdee893
commit
1f84917da0
2 changed files with 3 additions and 3 deletions
|
|
@ -74,14 +74,14 @@ func readGenesis(genesisPath string) *core.Genesis {
|
||||||
return genesis
|
return genesis
|
||||||
}
|
}
|
||||||
|
|
||||||
type ExecStats struct {
|
type execStats struct {
|
||||||
Time time.Duration `json:"time"` // The execution Time.
|
Time time.Duration `json:"time"` // The execution Time.
|
||||||
Allocs int64 `json:"allocs"` // The number of heap allocations during execution.
|
Allocs int64 `json:"allocs"` // The number of heap allocations during execution.
|
||||||
BytesAllocated int64 `json:"bytesAllocated"` // The cumulative number of bytes allocated during execution.
|
BytesAllocated int64 `json:"bytesAllocated"` // The cumulative number of bytes allocated during execution.
|
||||||
GasUsed uint64 `json:"gasUsed"` // the amount of gas used during execution
|
GasUsed uint64 `json:"gasUsed"` // the amount of gas used during execution
|
||||||
}
|
}
|
||||||
|
|
||||||
func timedExec(bench bool, execFunc func() ([]byte, uint64, error)) (output []byte, stats ExecStats, err error) {
|
func timedExec(bench bool, execFunc func() ([]byte, uint64, error)) (output []byte, stats execStats, err error) {
|
||||||
var gasUsed uint64
|
var gasUsed uint64
|
||||||
if bench {
|
if bench {
|
||||||
result := testing.Benchmark(func(b *testing.B) {
|
result := testing.Benchmark(func(b *testing.B) {
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ type StatetestResult struct {
|
||||||
Fork string `json:"fork"`
|
Fork string `json:"fork"`
|
||||||
Error string `json:"error,omitempty"`
|
Error string `json:"error,omitempty"`
|
||||||
State *state.Dump `json:"state,omitempty"`
|
State *state.Dump `json:"state,omitempty"`
|
||||||
BenchStats *ExecStats `json:"benchStats,omitempty"`
|
BenchStats *execStats `json:"benchStats,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func stateTestCmd(ctx *cli.Context) error {
|
func stateTestCmd(ctx *cli.Context) error {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue