cloudemu

Cross-Cutting Features

Recording, metrics, rate limiting, error injection, and more

Cross-Cutting Features

Every cloudemu service can be wrapped with a portable API layer that adds test-oriented features. These features compose together and work identically across all providers.

bucket := storage.NewBucket(aws.S3,
    storage.WithRecorder(rec),              // record every API call
    storage.WithMetrics(mc),                // track call counts and durations
    storage.WithErrorInjection(inj),        // simulate cloud failures
    storage.WithRateLimiter(limiter),       // simulate API throttling
    storage.WithLatency(5*time.Millisecond),// simulate network delay
)

Available Features

FeatureWhat It Does
Call RecordingCapture every API call with inputs, outputs, errors, and timing
MetricsTrack calls_total, call_duration, errors_total per operation
Rate LimitingToken bucket limiter that returns Throttled errors when exhausted
Error InjectionSimulate failures: always, every Nth call, probabilistic, or first N calls
Fake ClockControl time for deterministic testing of TTL, dedup, alarms
Latency SimulationAdd delays to test timeout handling

On this page