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