fuzzer

package
v0.0.0-...-ec8f3eb Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FuzzEngineOps

func FuzzEngineOps(ctx context.Context, e Engine, opsPerSec int,
	numWorkers int, stats *FuzzStats, namespace string, getOPs bool)

FuzzEngineOps concurrently runs fuzzing operations against an Engine using multiple worker goroutines.

func FuzzHTTPAPIOps

func FuzzHTTPAPIOps(ctx context.Context, apiBaseURL, namespace string, opsPerSec, numWorkers int, stats *FuzzStats, includeReads bool)

FuzzHTTPAPIOps runs the fuzzer loop against the HTTP API surface for the namespace.

func WriteFuzzRunCSV

func WriteFuzzRunCSV(path string, nsStats map[string]NamespaceStats, mode string, readers int) error

Types

type ColumnPool

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

func NewColumnPool

func NewColumnPool(size int) *ColumnPool

func (*ColumnPool) Get

func (cp *ColumnPool) Get(n int) map[string][]byte

func (*ColumnPool) Mutate

func (cp *ColumnPool) Mutate()

type Engine

type Engine interface {
	PutKV(key, value []byte) error
	BatchPutKV(keys, values [][]byte) error
	DeleteKV(key []byte) error
	BatchDeleteKV(keys [][]byte) error
	PutColumnsForRow(rowKey []byte, columnEntries map[string][]byte) error
	DeleteColumnsForRow(rowKey []byte, columnEntries map[string][]byte) error

	GetKV(key []byte) ([]byte, error)
	GetRowColumns(rowKey string, predicate func(columnKey string) bool) (map[string][]byte, error)
}

type FuzzStats

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

func NewFuzzStats

func NewFuzzStats() *FuzzStats

func (*FuzzStats) Inc

func (fs *FuzzStats) Inc(namespace, op string)

func (*FuzzStats) IncError

func (fs *FuzzStats) IncError(namespace string)

func (*FuzzStats) ObserveLatency

func (fs *FuzzStats) ObserveLatency(namespace string, dur time.Duration)

func (*FuzzStats) ServeHTTP

func (fs *FuzzStats) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*FuzzStats) Snapshot

func (fs *FuzzStats) Snapshot() map[string]NamespaceStats

func (*FuzzStats) StartStatsMonitor

func (fs *FuzzStats) StartStatsMonitor(ctx context.Context, interval time.Duration)

type HTTPAPIEngine

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

HTTPAPIEngine implements the Engine interface on top of the httpapi.Service.

apiBaseURL should point to the service prefix (e.g. http://localhost:8080/api/v1). Each method encodes/decodes payloads so the fuzzer can stress the full HTTP stack.

func NewHTTPAPIEngine

func NewHTTPAPIEngine(ctx context.Context, apiBaseURL, namespace string, client *http.Client) *HTTPAPIEngine

NewHTTPAPIEngine returns an Engine implementation backed by HTTP APIs. The provided client is optional; when nil a default client with a 10s timeout is used.

func (*HTTPAPIEngine) BatchDeleteKV

func (h *HTTPAPIEngine) BatchDeleteKV(keys [][]byte) error

func (*HTTPAPIEngine) BatchPutKV

func (h *HTTPAPIEngine) BatchPutKV(keys, values [][]byte) error

func (*HTTPAPIEngine) DeleteColumnsForRow

func (h *HTTPAPIEngine) DeleteColumnsForRow(rowKey []byte, columnEntries map[string][]byte) error

func (*HTTPAPIEngine) DeleteKV

func (h *HTTPAPIEngine) DeleteKV(key []byte) error

func (*HTTPAPIEngine) GetKV

func (h *HTTPAPIEngine) GetKV(key []byte) ([]byte, error)

func (*HTTPAPIEngine) GetRowColumns

func (h *HTTPAPIEngine) GetRowColumns(rowKey string, predicate func(columnKey string) bool) (map[string][]byte, error)

func (*HTTPAPIEngine) PutColumnsForRow

func (h *HTTPAPIEngine) PutColumnsForRow(rowKey []byte, columnEntries map[string][]byte) error

func (*HTTPAPIEngine) PutKV

func (h *HTTPAPIEngine) PutKV(key, value []byte) error

type KeyPool

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

func NewKeyPool

func NewKeyPool(size, minLen, maxLen int) *KeyPool

func (*KeyPool) Get

func (kp *KeyPool) Get(n int) [][]byte

func (*KeyPool) Mutate

func (kp *KeyPool) Mutate()

type NamespaceStats

type NamespaceStats struct {
	OpCount    map[string]int64 `json:"op_count"`
	ErrorCount int64            `json:"error_count"`
	OpsRate    float64          `json:"ops_rate"`
	Uptime     float64          `json:"uptime"`
	Throughput float64          `json:"throughput"`
	Duration   time.Duration
	Latency    map[string]float64 `json:"latency_ms,omitempty"`
}

type ValuePool

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

func NewValuePool

func NewValuePool(sizes []int, countPerSize int) *ValuePool

func (*ValuePool) Get

func (vp *ValuePool) Get() []byte

Jump to

Keyboard shortcuts

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