driver

package
v0.0.0-...-0cd06db Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ColumnTimestamp = 0
	ColumnAdds      = 1
	ColumnDeletes   = 2
	ColumnQueries   = 3
)

Variables

This section is empty.

Functions

func LoadTrace

func LoadTrace(f io.Reader) [][]int

func LoadTraceFile

func LoadTraceFile(filename string) [][]int

func NewServerDriver

func NewServerDriver() (*serverDriver, error)

func PirTypeStrings

func PirTypeStrings() []string

func RegisteredTypes

func RegisteredTypes() []reflect.Type

func SerializedSizeOf

func SerializedSizeOf(e interface{}) (int, error)

Types

type Config

type Config struct {
	TestConfig

	UseTLS     bool
	CpuProfile string

	// For client
	PirType       pir.PirType
	ServerAddr    string
	ServerAddr2   string
	UsePersistent bool

	// For server
	Port int

	// For benchmarks
	NumUpdates int
	Progress   bool
	TraceFile  string

	FlagSet *flag.FlagSet
	// contains filtered or unexported fields
}

func (*Config) AddBenchmarkFlags

func (c *Config) AddBenchmarkFlags() *Config

func (*Config) AddClientFlags

func (c *Config) AddClientFlags() *Config

func (*Config) AddPirFlags

func (c *Config) AddPirFlags() *Config

func (*Config) AddServerFlags

func (c *Config) AddServerFlags() *Config

func (*Config) Parse

func (c *Config) Parse() *Config

func (*Config) Server2Driver

func (c *Config) Server2Driver() (PirServerDriver, error)

func (*Config) ServerDriver

func (c *Config) ServerDriver() (PirServerDriver, error)

func (*Config) String

func (c *Config) String() string

type ErrorPrinter

type ErrorPrinter struct {
}

Disgusting hack since testing.Benchmark hides all logs and failures

func (ErrorPrinter) Fail

func (ep ErrorPrinter) Fail()

func (ErrorPrinter) FailNow

func (ep ErrorPrinter) FailNow()

func (ErrorPrinter) Log

func (ep ErrorPrinter) Log(args ...interface{})

type PirServerDriver

type PirServerDriver interface {
	updatable.UpdatableServer

	Configure(config TestConfig, none *int) error

	AddRows(numRows int, none *int) error
	DeleteRows(numRows int, none *int) error
	GetRow(idx int, row *RowIndexVal) error
	NumRows(none int, out *int) error
	NumKeys(none int, out *int) error
	RowLen(none int, out *int) error

	ResetMetrics(none int, none2 *int) error
	GetOfflineTimer(none int, out *time.Duration) error
	GetOnlineTimer(none int, out *time.Duration) error
	GetOfflineBytes(none int, out *int) error
	GetOnlineBytes(none int, out *int) error
}

type Profiler

type Profiler struct {
	// contains filtered or unexported fields
}

func NewProfiler

func NewProfiler(filename string) *Profiler

func (*Profiler) Close

func (p *Profiler) Close()

type RowIndexVal

type RowIndexVal struct {
	Index int
	Key   uint32
	Value pir.Row
}

type RpcProxy

type RpcProxy struct {
	*rpc.ClientProxy
}

func NewRpcProxy

func NewRpcProxy(serverAddr string, useTLS bool, usePersistent bool) (*RpcProxy, error)

func (*RpcProxy) AddRows

func (p *RpcProxy) AddRows(numRows int, none *int) error

func (*RpcProxy) Answer

func (p *RpcProxy) Answer(query pir.QueryReq, resp *interface{}) error

func (*RpcProxy) Configure

func (p *RpcProxy) Configure(config TestConfig, none *int) error

func (*RpcProxy) DeleteRows

func (p *RpcProxy) DeleteRows(numRows int, none *int) error

func (*RpcProxy) GetOfflineBytes

func (p *RpcProxy) GetOfflineBytes(none int, out *int) error

func (*RpcProxy) GetOfflineTimer

func (p *RpcProxy) GetOfflineTimer(none int, out *time.Duration) error

func (*RpcProxy) GetOnlineBytes

func (p *RpcProxy) GetOnlineBytes(none int, out *int) error

func (*RpcProxy) GetOnlineTimer

func (p *RpcProxy) GetOnlineTimer(none int, out *time.Duration) error

func (*RpcProxy) GetRow

func (p *RpcProxy) GetRow(idx int, row *RowIndexVal) error

func (*RpcProxy) Hint

func (p *RpcProxy) Hint(req pir.HintReq, resp *pir.HintResp) error

func (*RpcProxy) KeyUpdates

func (p *RpcProxy) KeyUpdates(req updatable.KeyUpdatesReq, resp *updatable.KeyUpdatesResp) error

func (*RpcProxy) NumKeys

func (p *RpcProxy) NumKeys(none int, out *int) error

func (*RpcProxy) NumRows

func (p *RpcProxy) NumRows(none int, out *int) error

func (*RpcProxy) ResetMetrics

func (p *RpcProxy) ResetMetrics(none int, none2 *int) error

func (*RpcProxy) RowLen

func (p *RpcProxy) RowLen(none int, out *int) error

type TestConfig

type TestConfig struct {
	NumRows int
	RowLen  int

	Updatable bool

	UpdateSize int

	PresetRows []RowIndexVal

	// Seed used to generate random data in database. Not used for cryptographic operations.
	DataRandSeed int64

	MeasureBandwidth bool
}

func (TestConfig) String

func (c TestConfig) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL