Documentation
¶
Index ¶
- func CheckRange(rows, expected []KV) error
- func CheckValue(actual, expected []byte) error
- func Payload(size, worker, index int, phase byte) []byte
- func PoissonSchedule(n int, rate float64, seed, stream uint64) ([]int64, error)
- func Run(cfg Config, db LifecycleDatabase, metadata map[string]any, afterIdentity Stats) error
- func StartProfile(mode, dir string) (func() error, error)
- func ValidateGRVWorkload(delta ClientCounters, workload string, completed int) error
- func WriteJSON(path string, value any) error
- func WriteSamples(path, phase string, samples []Sample) error
- type CleanupCounters
- type ClientCounters
- type Config
- type Database
- type Dataset
- func (d Dataset) Operation(db Database, workload string, worker int, payload []byte) (attempts int, err error)
- func (d *Dataset) PrepareBatchSet50(prefix string)
- func (d Dataset) Seed(db Database) error
- func (d Dataset) ValidateSeed(db Database) error
- func (d Dataset) ValidateWrites(db Database, workload string, warmup, measured int) error
- type FinalizerDrain
- type KV
- type Lifecycle
- type LifecycleDatabase
- type Pacing
- type Phase
- type Sample
- type Stats
- type Transaction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckRange ¶
func CheckValue ¶
func PoissonSchedule ¶
PoissonSchedule returns n start offsets in nanoseconds with exponential gaps averaging 1/rate seconds, from seed and stream: evenly spread on average, pseudo-random in detail. Streams give one seed independent schedules.
func StartProfile ¶
func ValidateGRVWorkload ¶
func ValidateGRVWorkload(delta ClientCounters, workload string, completed int) error
func WriteSamples ¶
Types ¶
type CleanupCounters ¶
type ClientCounters ¶
type ClientCounters struct {
Observation string `json:"observation"`
Values map[string]int64 `json:"values,omitempty"`
}
Native libfdb_c does not expose these counters through its public C API. Unobserved is distinct from an observed zero.
func CounterDelta ¶
func CounterDelta(before, after ClientCounters) (ClientCounters, error)
type Config ¶
type Config struct {
ClusterFile string `json:"cluster_file"`
Workload string `json:"workload"`
Iterations int `json:"iterations"`
Warmup int `json:"warmup"`
Workers int `json:"workers"`
Output string `json:"output"`
RunID string `json:"run_id"`
Block int `json:"block"`
SourceRevision string `json:"source_revision"`
HarnessID string `json:"harness_id"`
AllowWrites bool `json:"allow_writes"`
Prefix string `json:"prefix"`
TimeoutMS int64 `json:"transaction_timeout_ms"`
RetryLimit int64 `json:"retry_limit"`
Profile string `json:"profile"`
// CoalesceDelay is the Go client's connection write delay, "min,max" as Go
// durations; empty keeps the client default.
CoalesceDelay string `json:"coalesce_delay,omitempty"`
// AdaptiveLinger is the Go client's Nagle-style adaptive linger window; 0 keeps the default.
AdaptiveLinger time.Duration `json:"adaptive_linger_ns,omitempty"`
// Rate > 0 paces the run: operations start at Poisson arrival times averaging
// Rate per second, drawn from Seed, so every run with the same seed starts the
// same operations at the same offsets. Rate 0 is a closed loop.
Rate float64 `json:"rate,omitempty"`
Seed uint64 `json:"seed"`
// Duration selects fixed-time closed-loop mode; zero preserves count mode.
Duration time.Duration `json:"duration_ns,omitempty"`
WarmupDuration time.Duration `json:"warmup_duration_ns,omitempty"`
}
type Database ¶
type Database interface {
Transact(readOnly bool, fn func(Transaction) error) error
Local(fn func(Transaction) error) error
Counters() ClientCounters
Close()
}
type Dataset ¶
type Dataset struct {
Points map[int]KV
Range []KV
RangeEnd []byte
Writes [][]byte
Initial []byte
Warmup, Measure [][]byte
BatchWrites [][][]byte
BatchInitial [][]byte
BatchValueBytes int
}
func (*Dataset) PrepareBatchSet50 ¶
PrepareBatchSet50 pregenerates worker-local keys and operands so none of their allocation or formatting enters the measured phase.
func (Dataset) ValidateSeed ¶
type FinalizerDrain ¶
type FinalizerDrain struct {
Before CleanupCounters `json:"before"`
After CleanupCounters `json:"after"`
Rounds int `json:"rounds"`
WallNS int64 `json:"wall_ns"`
Complete bool `json:"complete"`
}
func DrainFinalizers ¶
func DrainFinalizers() (FinalizerDrain, error)
type Lifecycle ¶
type Lifecycle struct {
MeasurementDrain FinalizerDrain `json:"measurement_drain"`
MeasurementBarrier bool `json:"measurement_barrier_complete"`
AfterDrain Stats `json:"stats_after_measurement_drain"`
ShutdownDrain FinalizerDrain `json:"shutdown_drain"`
DatabaseClosed bool `json:"database_closed"`
NetworkStopped bool `json:"network_stopped"`
AfterShutdown Stats `json:"stats_after_shutdown"`
Complete bool `json:"complete"`
}
type LifecycleDatabase ¶
type LifecycleDatabase interface {
Database
Barrier() error
Shutdown() (networkStopped bool, err error)
}
LifecycleDatabase is owned by one benchmark process; Shutdown is terminal.
type Pacing ¶
type Pacing struct {
LagP50NS, LagP99NS, LagMaxNS int64
LateOver100us, LateOver1ms float64
GapCVActual, GapCVScheduled float64
Samples int
}
Pacing reports how closely a paced phase's actual starts followed its schedule: start lag (actual - scheduled start) and the coefficient of variation of the gaps between consecutive starts, actual and scheduled (about 1 for Poisson arrivals; bunched starts raise it, regularized starts lower it).
type Phase ¶
type Stats ¶
type Stats struct {
TotalAlloc uint64 `json:"go_total_alloc_bytes"`
Mallocs uint64 `json:"go_mallocs"`
GC uint32 `json:"go_gc_cycles"`
GCPause uint64 `json:"go_gc_pause_ns"`
UserUS int64 `json:"process_user_cpu_us"`
SystemUS int64 `json:"process_system_cpu_us"`
MaxRSSKB int64 `json:"process_high_water_rss_kb"`
}