benchclient

package
v0.0.0-...-59c1810 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2022 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResultSuccess  = 0
	ResultError    = 1
	ResultNotFound = 2
)
View Source
const (
	DummyStore          = "ds"
	DummyCache          = "dc"
	DummyCacheMissRatio = 50 // Miss ratio of cache, 10 means 10%
)

Variables

View Source
var (
	// The session the S3 Downloader will use
	AWSSession = session.Must(session.NewSessionWithOptions(session.Options{
		SharedConfigState: session.SharedConfigEnable,
		Config:            aws.Config{Region: aws.String("us-east-1")},
	}))
)
View Source
var (
	ErrNotSupported = errors.New("not supported")
)
View Source
var (
	// Default to disable client pooling.
	PoolSize = 1
)

Functions

func CreateLog

func CreateLog(opts map[string]interface{})

CreateLog Enabling evaluation log in client lib.

func FlushLog

func FlushLog()

FlushLog Flush logs to the file.y

func ResetDummySizeRegistry

func ResetDummySizeRegistry()

func SetLogger

func SetLogger(l func(nanolog.Handle, ...interface{}) error)

SetLogger set customized evaluation logger

Types

type ByteReader

type ByteReader struct {
	io.Reader
	// contains filtered or unexported fields
}

func NewByteReader

func NewByteReader(b []byte) *ByteReader

func (*ByteReader) Close

func (r *ByteReader) Close() error

func (*ByteReader) Len

func (r *ByteReader) Len() int

func (*ByteReader) ReadAll

func (r *ByteReader) ReadAll() ([]byte, error)

type Client

type Client interface {
	EcSet(string, []byte, ...interface{}) (string, error)
	EcGet(string, ...interface{}) (string, infinicache.ReadAllCloser, error)
	Close()
}

type Dummy

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

func NewDummy

func NewDummy(bandwidth int64, t string) *Dummy

NewDummy returns a new dummy client. bandwidth defined the bandwidth of the dummy client in B/s, 0 for unlimited.

func (Dummy) Close

func (c Dummy) Close()

func (Dummy) EcGet

func (c Dummy) EcGet(key string, args ...interface{}) (string, infinicache.ReadAllCloser, error)

func (Dummy) EcSet

func (c Dummy) EcSet(key string, val []byte, args ...interface{}) (string, error)

type DummyReadAllCloser

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

func (*DummyReadAllCloser) Close

func (r *DummyReadAllCloser) Close() error

func (*DummyReadAllCloser) Len

func (r *DummyReadAllCloser) Len() int

func (*DummyReadAllCloser) Read

func (r *DummyReadAllCloser) Read(p []byte) (n int, err error)

func (*DummyReadAllCloser) ReadAll

func (r *DummyReadAllCloser) ReadAll() ([]byte, error)

type File

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

func NewFile

func NewFile(provider string, path string) *File

func (File) Close

func (c File) Close()

func (File) EcGet

func (c File) EcGet(key string, args ...interface{}) (string, infinicache.ReadAllCloser, error)

func (File) EcSet

func (c File) EcSet(key string, val []byte, args ...interface{}) (string, error)

type Redis

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

func NewElasticCache

func NewElasticCache(addrPattern string, nodes int, numSlots int) *Redis

func NewRedis

func NewRedis(addr string) *Redis

func NewRedisClusterByAddresses

func NewRedisClusterByAddresses(addrs []string, numSlots int) *Redis

func NewRedisWithBackend

func NewRedisWithBackend(backend redis.UniversalClient) *Redis

func (*Redis) Close

func (r *Redis) Close()

func (Redis) EcGet

func (c Redis) EcGet(key string, args ...interface{}) (string, infinicache.ReadAllCloser, error)

func (Redis) EcSet

func (c Redis) EcSet(key string, val []byte, args ...interface{}) (string, error)

type RedisClusterSlotsProvider

type RedisClusterSlotsProvider func(context.Context) ([]redis.ClusterSlot, error)

func GenElasticCacheClusterSlotsProvider

func GenElasticCacheClusterSlotsProvider(addrPattern string, nodes int, numSlots int) RedisClusterSlotsProvider

func GenRedisClusterSlotsProviderByAddresses

func GenRedisClusterSlotsProviderByAddresses(addrs []string, numSlots int) RedisClusterSlotsProvider

type S3

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

func NewS3

func NewS3(bk string) *S3

func (S3) Close

func (c S3) Close()

func (S3) EcGet

func (c S3) EcGet(key string, args ...interface{}) (string, infinicache.ReadAllCloser, error)

func (S3) EcSet

func (c S3) EcSet(key string, val []byte, args ...interface{}) (string, error)

Jump to

Keyboard shortcuts

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