executor: vmstats in json
This commit is contained in:
parent
fc46430065
commit
2dce5ae65c
|
@ -1,6 +1,7 @@
|
|||
package executor
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
|
@ -33,13 +34,25 @@ type Config struct {
|
|||
}
|
||||
|
||||
type Result struct {
|
||||
Status int64
|
||||
GasUsed uint64
|
||||
SyscallCount int64
|
||||
ExecDur time.Duration
|
||||
PagesBeforeExec int
|
||||
PagesUsed int
|
||||
StartTime time.Time
|
||||
Status int64 `json:"status"`
|
||||
GasUsed uint64 `json:"gas_used"`
|
||||
SyscallCount int64 `json:"syscall_count"`
|
||||
ExecDur time.Duration `json:"exec_dur"`
|
||||
PagesBeforeExec int `json:"pages_before_exec"`
|
||||
PagesUsed int `json:"pages_used"`
|
||||
StartTime time.Time `json:"start_time"`
|
||||
}
|
||||
|
||||
func (r Result) StatsJSONFile() txtar.File {
|
||||
data, err := json.MarshalIndent(r, "", " ")
|
||||
if err != nil /* unlikely */ {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return txtar.File{
|
||||
Name: "vmstats.json",
|
||||
Data: data,
|
||||
}
|
||||
}
|
||||
|
||||
func (r Result) StatsFile() txtar.File {
|
||||
|
|
Loading…
Reference in New Issue