Documentation
¶
Index ¶
- func BenchmarkAIComplianceChecks_AllFrameworks(b *testing.B)
- func BenchmarkAIComplianceChecks_EU_AI_Act(b *testing.B)
- func BenchmarkAIComplianceChecks_NIST_AI_RMF(b *testing.B)
- func BenchmarkAIComplianceChecks_ValidationTime(b *testing.B)
- func BenchmarkAIWorkload_FullPipeline(b *testing.B)
- func BenchmarkAIWorkload_P99Latency(b *testing.B)
- func BenchmarkAutoscalingReadiness(b *testing.B)
- func BenchmarkConcurrencyScaling(b *testing.B)
- func BenchmarkConnectionFlood(b *testing.B)
- func BenchmarkLLMRequestLatency_Claude(b *testing.B)
- func BenchmarkLLMRequestLatency_Concurrent(b *testing.B)
- func BenchmarkLLMRequestLatency_EndToEnd(b *testing.B)
- func BenchmarkLLMRequestLatency_GPT4(b *testing.B)
- func BenchmarkLLMRequestLatency_Llama(b *testing.B)
- func BenchmarkLLMRequestLatency_PayloadSize(b *testing.B)
- func BenchmarkLLMRequestLatency_Streaming(b *testing.B)
- func BenchmarkLatency(b *testing.B)
- func BenchmarkMemoryStress(b *testing.B)
- func BenchmarkMemoryUsage(b *testing.B)
- func BenchmarkPromptInjectionScanning_DetectionLatency(b *testing.B)
- func BenchmarkPromptInjectionScanning_DetectionOverhead(b *testing.B)
- func BenchmarkPromptInjectionScanning_FalsePositiveRate(b *testing.B)
- func BenchmarkPromptInjectionScanning_VariousPayloads(b *testing.B)
- func BenchmarkSIEMEventCreation(b *testing.B)
- func BenchmarkScannerConcurrent(b *testing.B)
- func BenchmarkScannerThroughput(b *testing.B)
- func BenchmarkSimulatedRPS10K(b *testing.B)
- func BenchmarkSimulatedRPS25K(b *testing.B)
- func BenchmarkSimulatedRPS50K(b *testing.B)
- func BenchmarkSimulatedRPS100K(b *testing.B)
- func BenchmarkTokenLimitEnforcement_Concurrent(b *testing.B)
- func BenchmarkTokenLimitEnforcement_Counting(b *testing.B)
- func BenchmarkTokenLimitEnforcement_LimitCheck(b *testing.B)
- func BenchmarkTokenLimitEnforcement_StreamTokenCount(b *testing.B)
- func BenchmarkVectorEmbeddingRequests_BatchEmbedding(b *testing.B)
- func BenchmarkVectorEmbeddingRequests_BatchSizes(b *testing.B)
- func BenchmarkVectorEmbeddingRequests_ConcurrentEmbedding(b *testing.B)
- func BenchmarkVectorEmbeddingRequests_LargeVectors(b *testing.B)
- func BenchmarkVectorEmbeddingRequests_PayloadProcessing(b *testing.B)
- func BenchmarkVectorEmbeddingRequests_SingleVector(b *testing.B)
- func DefaultRPSConfigs() map[RPSLevel]RPSConfig
- func LatencyBuckets() []string
- func ValidateFloodResult(r *FloodResult) error
- func ValidateLatency(r *LatencyResult) error
- func ValidateMemoryResult(r *MemoryResult) error
- type ConnectionFloodTest
- type FloodResult
- type LLMRequestType
- type LatencyBenchmark
- type LatencyResult
- type MemoryResult
- type MemorySample
- type MemoryStressTest
- type RPSConfig
- type RPSLevel
- type RPSResult
- type RPSTimeSeriesSample
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BenchmarkAIComplianceChecks_AllFrameworks ¶
BenchmarkAIComplianceChecks_AllFrameworks measures all AI frameworks
func BenchmarkAIComplianceChecks_EU_AI_Act ¶
BenchmarkAIComplianceChecks_EU_AI_Act measures EU AI Act requirements
func BenchmarkAIComplianceChecks_NIST_AI_RMF ¶
BenchmarkAIComplianceChecks_NIST_AI_RMF measures NIST AI RMF controls
func BenchmarkAIComplianceChecks_ValidationTime ¶
BenchmarkAIComplianceChecks_ValidationTime measures compliance validation time
func BenchmarkAIWorkload_FullPipeline ¶
BenchmarkAIWorkload_FullPipeline measures full AI workload pipeline
func BenchmarkAIWorkload_P99Latency ¶
BenchmarkAIWorkload_P99Latency measures P99 latency target (<50ms)
func BenchmarkAutoscalingReadiness ¶
BenchmarkAutoscalingReadiness evaluates readiness for auto-scaling
func BenchmarkConcurrencyScaling ¶
BenchmarkConcurrencyScaling measures performance as concurrency increases
func BenchmarkLLMRequestLatency_Claude ¶
BenchmarkLLMRequestLatency_Claude patterns simulates Claude request patterns
func BenchmarkLLMRequestLatency_Concurrent ¶
BenchmarkLLMRequestLatency_Concurrent measures concurrent LLM request handling
func BenchmarkLLMRequestLatency_EndToEnd ¶
BenchmarkLLMRequestLatency_EndToEnd measures end-to-end latency through proxy
func BenchmarkLLMRequestLatency_GPT4 ¶
BenchmarkLLMRequestLatency_GPT4 patterns simulates GPT-4 request patterns
func BenchmarkLLMRequestLatency_Llama ¶
BenchmarkLLMRequestLatency_Llama patterns simulates Llama request patterns
func BenchmarkLLMRequestLatency_PayloadSize ¶
BenchmarkLLMRequestLatency_PayloadSize compares different payload sizes
func BenchmarkLLMRequestLatency_Streaming ¶
BenchmarkLLMRequestLatency_Streaming measures streaming vs non-streaming overhead
func BenchmarkLatency ¶
func BenchmarkMemoryStress ¶
func BenchmarkMemoryUsage ¶
BenchmarkMemoryUsage benchmarks memory usage under load
func BenchmarkPromptInjectionScanning_DetectionLatency ¶
BenchmarkPromptInjectionScanning_DetectionLatency measures detection latency
func BenchmarkPromptInjectionScanning_DetectionOverhead ¶
BenchmarkPromptInjectionScanning_DetectionOverhead measures detection overhead
func BenchmarkPromptInjectionScanning_FalsePositiveRate ¶
BenchmarkPromptInjectionScanning_FalsePositiveRate measures false positive impact
func BenchmarkPromptInjectionScanning_VariousPayloads ¶
BenchmarkPromptInjectionScanning_VariousPayloads tests various injection payloads
func BenchmarkSIEMEventCreation ¶
BenchmarkSIEMEventCreation benchmarks SIEM event creation at scale
func BenchmarkScannerConcurrent ¶
BenchmarkScannerConcurrent benchmarks scanner with concurrent requests
func BenchmarkScannerThroughput ¶
BenchmarkScannerThroughput benchmarks scanner at different RPS levels
func BenchmarkSimulatedRPS10K ¶
BenchmarkSimulatedRPS10K simulates 10k RPS internally
func BenchmarkSimulatedRPS25K ¶
BenchmarkSimulatedRPS25K simulates 25k RPS internally
func BenchmarkSimulatedRPS50K ¶
BenchmarkSimulatedRPS50K simulates 50k RPS internally
func BenchmarkSimulatedRPS100K ¶
BenchmarkSimulatedRPS100K simulates 100k RPS internally
func BenchmarkTokenLimitEnforcement_Concurrent ¶
BenchmarkTokenLimitEnforcement_Concurrent measures concurrent token counting
func BenchmarkTokenLimitEnforcement_Counting ¶
BenchmarkTokenLimitEnforcement_Counting measures token counting performance
func BenchmarkTokenLimitEnforcement_LimitCheck ¶
BenchmarkTokenLimitEnforcement_LimitCheck measures enforcement latency
func BenchmarkTokenLimitEnforcement_StreamTokenCount ¶
BenchmarkTokenLimitEnforcement_StreamTokenCount measures streaming token count
func BenchmarkVectorEmbeddingRequests_BatchEmbedding ¶
BenchmarkVectorEmbeddingRequests_BatchEmbedding measures batch embedding requests
func BenchmarkVectorEmbeddingRequests_BatchSizes ¶
BenchmarkVectorEmbeddingRequests_BatchSizes measures different batch sizes
func BenchmarkVectorEmbeddingRequests_ConcurrentEmbedding ¶
BenchmarkVectorEmbeddingRequests_ConcurrentEmbedding measures concurrent embeddings
func BenchmarkVectorEmbeddingRequests_LargeVectors ¶
BenchmarkVectorEmbeddingRequests_LargeVectors measures large embedding vectors
func BenchmarkVectorEmbeddingRequests_PayloadProcessing ¶
BenchmarkVectorEmbeddingRequests_PayloadProcessing measures payload processing
func BenchmarkVectorEmbeddingRequests_SingleVector ¶
BenchmarkVectorEmbeddingRequests_SingleVector measures single embedding request
func DefaultRPSConfigs ¶
DefaultRPSConfigs returns default configurations for each RPS level
func LatencyBuckets ¶
func LatencyBuckets() []string
LatencyBuckets returns predefined latency bucket boundaries
func ValidateFloodResult ¶
func ValidateFloodResult(r *FloodResult) error
func ValidateLatency ¶
func ValidateLatency(r *LatencyResult) error
func ValidateMemoryResult ¶
func ValidateMemoryResult(r *MemoryResult) error
Types ¶
type ConnectionFloodTest ¶
type ConnectionFloodTest struct {
TargetHost string
TargetPort int
MaxConnections int
Duration time.Duration
}
ConnectionFloodTest simulates 10K concurrent connections
func NewConnectionFloodTest ¶
func NewConnectionFloodTest(host string, port int) *ConnectionFloodTest
func (*ConnectionFloodTest) Run ¶
func (c *ConnectionFloodTest) Run(ctx context.Context) (*FloodResult, error)
type FloodResult ¶
type LLMRequestType ¶
type LLMRequestType int
LLMRequestType represents different LLM API patterns
const ( LLMChatCompletion LLMRequestType = iota LLMStreaming LLMEmbedding LLMCompletion )
type LatencyBenchmark ¶
type LatencyBenchmark struct {
TargetHost string
TargetPort int
RequestCount int
Concurrency int
RequestInterval time.Duration
}
LatencyBenchmark measures response times under load
func NewLatencyBenchmark ¶
func NewLatencyBenchmark(host string, port int) *LatencyBenchmark
func (*LatencyBenchmark) Run ¶
func (l *LatencyBenchmark) Run(ctx context.Context) (*LatencyResult, error)
type LatencyResult ¶
type MemoryResult ¶
type MemorySample ¶
type MemoryStressTest ¶
type MemoryStressTest struct {
TargetHost string
TargetPort int
Duration time.Duration
ConnInterval time.Duration
}
MemoryStressTest detects memory leaks under sustained load
func NewMemoryStressTest ¶
func NewMemoryStressTest(host string, port int) *MemoryStressTest
func (*MemoryStressTest) Run ¶
func (m *MemoryStressTest) Run(ctx context.Context) (*MemoryResult, error)
type RPSConfig ¶
type RPSConfig struct {
Level RPSLevel
TargetRPS int
Duration time.Duration
WarmupDuration time.Duration
CooldownDuration time.Duration
Concurrency int
RequestTimeout time.Duration
TargetHost string
TargetPort int
UseHTTPS bool
KeepAlive bool
NumClients int
}
RPSConfig defines the configuration for an RPS load test
type RPSResult ¶
type RPSResult struct {
Config RPSConfig
StartTime time.Time
EndTime time.Time
TotalDuration time.Duration
// Throughput metrics
ActualRPS float64
TargetRPS float64
RPSAchievement float64 // Percentage of target achieved
// Request metrics
TotalRequests int64
SuccessCount int64
ErrorCount int64
TimeoutCount int64
ConnectionError int64
// Latency metrics
MinLatency time.Duration
MaxLatency time.Duration
AvgLatency time.Duration
P50Latency time.Duration
P90Latency time.Duration
P95Latency time.Duration
P99Latency time.Duration
P999Latency time.Duration
P9999Latency time.Duration
// Latency percentiles (histogram buckets)
LatencyBuckets map[string]int64
// Error breakdown
ErrorBreakdown map[string]int64
// Resource metrics
AvgMemoryMB float64
PeakMemoryMB float64
AvgCPUPercent float64
NumGC uint32
// Scaling metrics (for auto-scaling analysis)
Samples []RPSTimeSeriesSample
}
RPSResult contains the results of an RPS load test