Interface for benchmarking
This commit is contained in:
parent
fda1488ae2
commit
57454cb00b
@ -3,6 +3,7 @@ package common
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"runtime"
|
||||
"time"
|
||||
)
|
||||
@ -99,6 +100,10 @@ type DirectorySummary struct {
|
||||
IgnoredErrorCount int `json:"numIgnoredErrors,omitempty"`
|
||||
}
|
||||
|
||||
type ManifestDecoder interface {
|
||||
Decode(r io.Reader, gcStats bool) error
|
||||
}
|
||||
|
||||
func PrintMemUsage() {
|
||||
var m runtime.MemStats
|
||||
|
||||
|
||||
@ -9,6 +9,17 @@ import (
|
||||
"github.com/alcionai/corso/src/cmd/jsondebug/common"
|
||||
)
|
||||
|
||||
var (
|
||||
_ common.ManifestDecoder = Array{}
|
||||
)
|
||||
|
||||
type Array struct{}
|
||||
|
||||
func (d Array) Decode(r io.Reader, gcStats bool) error {
|
||||
_, err := DecodeManifestArray(r)
|
||||
return err
|
||||
}
|
||||
|
||||
func DecodeManifestArray(r io.Reader) (common.Manifest, error) {
|
||||
var (
|
||||
dec = json.NewDecoder(r)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user