github.com/eth-easl/loader@v0.0.0-20230908084258-8a37e1d94279/pkg/common/constants.go (about)

     1  /*
     2   * MIT License
     3   *
     4   * Copyright (c) 2023 EASL and the vHive community
     5   *
     6   * Permission is hereby granted, free of charge, to any person obtaining a copy
     7   * of this software and associated documentation files (the "Software"), to deal
     8   * in the Software without restriction, including without limitation the rights
     9   * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    10   * copies of the Software, and to permit persons to whom the Software is
    11   * furnished to do so, subject to the following conditions:
    12   *
    13   * The above copyright notice and this permission notice shall be included in all
    14   * copies or substantial portions of the Software.
    15   *
    16   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    17   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    18   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    19   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    20   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    21   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    22   * SOFTWARE.
    23   */
    24  
    25  package common
    26  
    27  const (
    28  	FunctionNamePrefix      = "trace-func"
    29  	OneSecondInMicroseconds = 1_000_000.0
    30  )
    31  
    32  const (
    33  	// MinExecTimeMilli 1ms (min. billing unit of AWS)
    34  	MinExecTimeMilli = 1
    35  
    36  	// MaxExecTimeMilli 60s (avg. p96 from Wild)
    37  	MaxExecTimeMilli = 60e3
    38  )
    39  
    40  const (
    41  	// MaxMemQuotaMib Number taken from AWS Lambda settings
    42  	// https://docs.aws.amazon.com/lambda/latest/dg/configuration-function-common.html#configuration-memory-console
    43  	MaxMemQuotaMib = 10_240
    44  	MinMemQuotaMib = 1
    45  
    46  	// OvercommitmentRatio Machine overcommitment ratio to provide to CPU requests in YAML specification.
    47  	// Value taken from the Firecracker NSDI'20 paper.
    48  	OvercommitmentRatio = 10
    49  )
    50  
    51  type IatDistribution int
    52  
    53  const (
    54  	Exponential IatDistribution = iota
    55  	Uniform
    56  	Equidistant
    57  )
    58  
    59  type TraceGranularity int
    60  
    61  const (
    62  	MinuteGranularity TraceGranularity = iota
    63  	SecondGranularity
    64  )
    65  
    66  type ExperimentPhase int
    67  
    68  const (
    69  	WarmupPhase    ExperimentPhase = 1
    70  	ExecutionPhase ExperimentPhase = 2
    71  )
    72  
    73  const (
    74  	// RequestedVsIssuedWarnThreshold Print warning on stdout if the relative difference between requested
    75  	// and issued number of invocations is higher than this threshold
    76  	RequestedVsIssuedWarnThreshold = 0.1
    77  	// RequestedVsIssuedTerminateThreshold Terminate experiment if the relative difference between
    78  	// requested and issued number of invocations is higher than this threshold
    79  	RequestedVsIssuedTerminateThreshold = 0.2
    80  
    81  	// FailedWarnThreshold Print warning on stdout if the percentage of failed invocations (e.g., connection timeouts,
    82  	// function timeouts) is greater than this threshold
    83  	FailedWarnThreshold = 0.3
    84  	// FailedTerminateThreshold Terminate experiment if the percentage of failed invocations (e.g., connection timeouts,
    85  	// function timeouts) is greater than this threshold
    86  	FailedTerminateThreshold = 0.5
    87  )
    88  
    89  type RuntimeAssertType int
    90  
    91  const (
    92  	RequestedVsIssued RuntimeAssertType = 0
    93  	IssuedVsFailed    RuntimeAssertType = 1
    94  )