app

package
v0.0.0-...-6b834e2 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2024 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Kibi
	Mebi
)
View Source
const ClocksPerSec = C.CLOCKS_PER_SEC

Variables

This section is empty.

Functions

func CPUTests

func CPUTests(logger logr.Logger, r *gin.RouterGroup, cpuTest CPUWaster) *gin.RouterGroup

func CustomMetricsTests

func CustomMetricsTests(logger logr.Logger, r *gin.RouterGroup, customMetricTest CustomMetricClient) *gin.RouterGroup

func DiskTest

func DiskTest(r *gin.RouterGroup, diskOccupier DiskOccupier) *gin.RouterGroup

func Error

func Error(c *gin.Context, status int, descriptionf string, args ...any)

func GetClock

func GetClock() float64

func MemoryTests

func MemoryTests(logger logr.Logger, r *gin.RouterGroup, memoryTest MemoryGobbler) *gin.RouterGroup

func New

func New(logger *zap.Logger, address string) *http.Server

func NewDefaultDiskOccupier

func NewDefaultDiskOccupier(filePath string) *defaultDiskOccupier

func ResponseTimeTests

func ResponseTimeTests(logger logr.Logger, r *gin.RouterGroup, timeWaster TimeWaster) *gin.RouterGroup

func Router

func Router(logger *zap.Logger, timewaster TimeWaster, memoryTest MemoryGobbler,
	cpuTest CPUWaster, diskOccupier DiskOccupier, customMetricTest CustomMetricClient) *gin.Engine

Types

type CPUWaster

type CPUWaster interface {
	UseCPU(utilisation uint64, duration time.Duration)
	IsRunning() bool
	StopTest()
}

type ConcurrentBusyLoopCPUWaster

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

func (*ConcurrentBusyLoopCPUWaster) IsRunning

func (m *ConcurrentBusyLoopCPUWaster) IsRunning() bool

func (*ConcurrentBusyLoopCPUWaster) StopTest

func (m *ConcurrentBusyLoopCPUWaster) StopTest()

func (*ConcurrentBusyLoopCPUWaster) UseCPU

func (m *ConcurrentBusyLoopCPUWaster) UseCPU(utilisation uint64, duration time.Duration)

type CustomMetricAPIClient

type CustomMetricAPIClient struct{}

func (*CustomMetricAPIClient) PostCustomMetric

func (*CustomMetricAPIClient) PostCustomMetric(ctx context.Context, appConfig *cfenv.App, metricValue float64, metricName string, useMtls bool) error

type CustomMetricClient

type CustomMetricClient interface {
	PostCustomMetric(ctx context.Context, appConfig *cfenv.App, metricsValue float64, metricName string, useMtls bool) error
}

type DiskOccupier

type DiskOccupier interface {
	Occupy(space int64, duration time.Duration) error
	Stop()
}

type ListBasedMemoryGobbler

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

func (*ListBasedMemoryGobbler) IsRunning

func (m *ListBasedMemoryGobbler) IsRunning() bool

func (*ListBasedMemoryGobbler) Sleep

func (m *ListBasedMemoryGobbler) Sleep(sleepTime time.Duration)

func (*ListBasedMemoryGobbler) StopTest

func (m *ListBasedMemoryGobbler) StopTest()

func (*ListBasedMemoryGobbler) UseMemory

func (m *ListBasedMemoryGobbler) UseMemory(numBytes uint64)

type MemoryGobbler

type MemoryGobbler interface {
	UseMemory(numBytes uint64)
	Sleep(sleepTime time.Duration)
	IsRunning() bool
	StopTest()
}

type Sleeper

type Sleeper struct{}

func (Sleeper) Sleep

func (Sleeper) Sleep(sleepTime time.Duration)

type TimeWaster

type TimeWaster interface {
	Sleep(sleepTime time.Duration)
}

Jump to

Keyboard shortcuts

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