common

package
v0.0.0-...-49965f9 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

View Source
const (
	FunctionNamePrefix      = "trace-func"
	OneSecondInMicroseconds = 1_000_000.0
)
View Source
const (
	// MinExecTimeMilli 1ms (min. billing unit of AWS)
	MinExecTimeMilli = 1

	// MaxExecTimeMilli 60s (avg. p96 from Wild)
	MaxExecTimeMilli = 60e3
)
View Source
const (
	// MaxMemQuotaMib Number taken from AWS Lambda settings
	// https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-memory-console
	MaxMemQuotaMib = 10_240
	MinMemQuotaMib = 1

	// OvercommitmentRatio Machine overcommitment ratio to provide to CPU requests in YAML specification.
	// Value taken from the Firecracker NSDI'20 paper.
	OvercommitmentRatio = 10
)
View Source
const (
	// RequestedVsIssuedWarnThreshold Print warning on stdout if the relative difference between requested
	// and issued number of invocations is higher than this threshold
	RequestedVsIssuedWarnThreshold = 0.1
	// RequestedVsIssuedTerminateThreshold Terminate experiment if the relative difference between
	// requested and issued number of invocations is higher than this threshold
	RequestedVsIssuedTerminateThreshold = 0.2

	// FailedWarnThreshold Print warning on stdout if the percentage of failed invocations (e.g., connection timeouts,
	// function timeouts) is greater than this threshold
	FailedWarnThreshold = 0.3
	// FailedTerminateThreshold Terminate experiment if the percentage of failed invocations (e.g., connection timeouts,
	// function timeouts) is greater than this threshold
	FailedTerminateThreshold = 0.5
)
View Source
const (
	AwsRegion                  = "us-east-1"
	AwsTraceFuncRepositoryName = "invitro_trace_function_aws"
)

Variables

This section is empty.

Functions

func B2Kib

func B2Kib(numB uint32) uint32

func Check

func Check(e error)

func Hash

func Hash(s string) uint64

func Hex2Int

func Hex2Int(hexStr string) int64

func Kib2Mib

func Kib2Mib(numB uint32) uint32

func MaxOf

func MaxOf(vars ...int) int

func Mib2Kib

func Mib2Kib(numMb uint32) uint32

func Mib2b

func Mib2b(numMb uint32) uint32

func MinOf

func MinOf(vars ...int) int

func RandBool

func RandBool() bool

func RandIntBetween

func RandIntBetween(min, max int) int

func SumNumberOfInvocations

func SumNumberOfInvocations(withWarmup bool, totalDuration int, functions []*Function) int

Types

type DirigentMetadata

type DirigentMetadata struct {
	HashFunction        string `csv:"HashFunction"`
	Image               string `csv:"Image"`
	Port                int    `csv:"Port"`
	Protocol            string `csv:"Protocol"`
	ScalingUpperBound   int    `csv:"ScalingUpperBound"`
	ScalingLowerBound   int    `csv:"ScalingLowerBound"`
	IterationMultiplier int    `csv:"IterationMultiplier"`
}

type ExperimentPhase

type ExperimentPhase int
const (
	WarmupPhase    ExperimentPhase = 1
	ExecutionPhase ExperimentPhase = 2
)

type Function

type Function struct {
	Name     string
	Endpoint string

	// From the static trace profiler
	InitialScale int
	// From the trace
	InvocationStats  *FunctionInvocationStats
	RuntimeStats     *FunctionRuntimeStats
	MemoryStats      *FunctionMemoryStats
	DirigentMetadata *DirigentMetadata

	CPURequestsMilli  int
	MemoryRequestsMiB int
	CPULimitsMilli    int

	Specification *FunctionSpecification
}

type FunctionInvocationStats

type FunctionInvocationStats struct {
	HashOwner    string
	HashApp      string
	HashFunction string
	Trigger      string

	Invocations []int
}

type FunctionMemoryStats

type FunctionMemoryStats struct {
	HashOwner    string `csv:"HashOwner"`
	HashApp      string `csv:"HashApp"`
	HashFunction string `csv:"HashFunction"`

	Count   float64 `csv:"SampleCount"`
	Average float64 `csv:"AverageAllocatedMb"`

	Percentile1   float64 `csv:"AverageAllocatedMb_pct1"`
	Percentile5   float64 `csv:"AverageAllocatedMb_pct5"`
	Percentile25  float64 `csv:"AverageAllocatedMb_pct25"`
	Percentile50  float64 `csv:"AverageAllocatedMb_pct50"`
	Percentile75  float64 `csv:"AverageAllocatedMb_pct75"`
	Percentile95  float64 `csv:"AverageAllocatedMb_pct95"`
	Percentile99  float64 `csv:"AverageAllocatedMb_pct99"`
	Percentile100 float64 `csv:"AverageAllocatedMb_pct100"`
}

type FunctionRuntimeStats

type FunctionRuntimeStats struct {
	HashOwner    string `csv:"HashOwner"`
	HashApp      string `csv:"HashApp"`
	HashFunction string `csv:"HashFunction"`

	Average float64 `csv:"Average"`
	Count   float64 `csv:"Count"`
	Minimum float64 `csv:"Minimum"`
	Maximum float64 `csv:"Maximum"`

	Percentile0   float64 `csv:"percentile_Average_0"`
	Percentile1   float64 `csv:"percentile_Average_1"`
	Percentile25  float64 `csv:"percentile_Average_25"`
	Percentile50  float64 `csv:"percentile_Average_50"`
	Percentile75  float64 `csv:"percentile_Average_75"`
	Percentile99  float64 `csv:"percentile_Average_99"`
	Percentile100 float64 `csv:"percentile_Average_100"`
}

type FunctionSpecification

type FunctionSpecification struct {
	IAT                  IATMatrix                  `json:"IAT"`
	RawDuration          ProbabilisticDuration      `json:"RawDuration"`
	RuntimeSpecification RuntimeSpecificationMatrix `json:"RuntimeSpecification"`
}

type IATMatrix

type IATMatrix [][]float64

IATMatrix - columns are minutes, rows are IATs

type IatDistribution

type IatDistribution int
const (
	Exponential IatDistribution = iota
	Uniform
	Equidistant
)

type Pair

type Pair struct {
	Key   interface{}
	Value int
}

type PairList

type PairList []Pair

func (PairList) Len

func (p PairList) Len() int

func (PairList) Less

func (p PairList) Less(i, j int) bool

func (PairList) Swap

func (p PairList) Swap(i, j int)

type ProbabilisticDuration

type ProbabilisticDuration []float64

ProbabilisticDuration used for testing the exponential distribution

type RuntimeAssertType

type RuntimeAssertType int
const (
	RequestedVsIssued RuntimeAssertType = 0
	IssuedVsFailed    RuntimeAssertType = 1
)

type RuntimeSpecification

type RuntimeSpecification struct {
	Runtime int
	Memory  int
}

type RuntimeSpecificationMatrix

type RuntimeSpecificationMatrix [][]RuntimeSpecification

type TraceGranularity

type TraceGranularity int
const (
	MinuteGranularity TraceGranularity = iota
	SecondGranularity
)

Jump to

Keyboard shortcuts

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