breakwater

package
v0.0.0-...-ac33b20 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2024 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

View Source
const DELAY_THRESHOLD_PERCENT float64 = 0.4 // target is 0.4 of SLA as per Breakwater
View Source
const MAX_Q_LENGTH = 50 // max length of queue

Variables

View Source
var RTT_MICROSECOND int64 // RTT in microseconds

make RTT configurable from input

Functions

This section is empty.

Types

type BWParameters

type BWParameters struct {
	ServerSide              bool
	BFactor                 float64
	AFactor                 float64
	SLO                     int64
	ClientExpiration        int64
	InitialCredits          int64
	Verbose                 bool
	UseClientTimeExpiration bool
	LoadShedding            bool
	UseClientQueueLength    bool
	RTT_MICROSECOND         int64
}
var BWParametersDefault BWParameters = BWParameters{
	ServerSide:              false,
	BFactor:                 0.02,
	AFactor:                 0.001,
	SLO:                     160,
	ClientExpiration:        1000,
	InitialCredits:          1000,
	Verbose:                 false,
	UseClientTimeExpiration: true,
	LoadShedding:            true,
	UseClientQueueLength:    false,
	RTT_MICROSECOND:         5000,
}

Default values for breakwater parameters: a = 0.1%, b = 2%, d_t = 40% of SLA, AQM threshold = 2 * d_t

type Breakwater

type Breakwater struct {
	SLO int64 // SLA in microseconds
	// contains filtered or unexported fields
}

func InitBreakwater

func InitBreakwater(param BWParameters) (bw *Breakwater)

func (*Breakwater) PrintOutgoingCredits

func (b *Breakwater) PrintOutgoingCredits()

func (*Breakwater) RegisterClient

func (b *Breakwater) RegisterClient(id uuid.UUID, demand int64)

Jiali: We need another fast function for server side interceptor to check and register client

func (*Breakwater) UnaryInterceptor

func (b *Breakwater) UnaryInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)

The server side interceptor It should 1. Manage connections and register requests 2. Check for queueing delays 3. Update credits issued 4. Occassionally update cTotal

func (*Breakwater) UnaryInterceptorClient

func (b *Breakwater) UnaryInterceptorClient(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error

type Connection

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

DATA STRUCTURES: 1. A global map of all active connections, which stores cIssued, cOC and cDemand 2. A queue of all pending requests, also tracking what time the earliest request is (queue head) 3. cTotal 4. cIssued

type DelayOperation

type DelayOperation struct {
	Value    float64      // For setting a value
	Response chan float64 // For getting a value
}

Jump to

Keyboard shortcuts

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