resource_debugdb

package
v0.51.4 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotSupported = errors.New("storage benchmarks only available in browser")

ErrNotSupported is returned when benchmarking is not available.

Functions

This section is empty.

Types

type BenchmarkResource

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

BenchmarkResource wraps a BenchmarkRunner as a DebugDbBenchmarkService resource.

func NewBenchmarkResource

func NewBenchmarkResource(le *logrus.Entry, runner *BenchmarkRunner) *BenchmarkResource

NewBenchmarkResource creates a new BenchmarkResource.

func (*BenchmarkResource) GetMux

func (r *BenchmarkResource) GetMux() srpc.Invoker

GetMux returns the rpc mux.

func (*BenchmarkResource) GetResults

GetResults returns the full benchmark results after completion.

func (*BenchmarkResource) WatchProgress

WatchProgress streams benchmark progress updates.

type BenchmarkRunner

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

BenchmarkRunner executes storage benchmark suites. On non-WASM platforms this is a stub that returns an error.

func NewBenchmarkRunner

NewBenchmarkRunner creates a new benchmark runner.

func (*BenchmarkRunner) GetResults

GetResults returns an error on non-WASM platforms.

func (*BenchmarkRunner) Run

func (r *BenchmarkRunner) Run(_ context.Context)

Run is a no-op on non-WASM platforms.

func (*BenchmarkRunner) WatchProgress

func (r *BenchmarkRunner) WatchProgress() (s4wave_debugdb.WatchProgressResponse, <-chan struct{})

WatchProgress returns the current progress.

type DebugDbResource

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

DebugDbResource implements the DebugDbResourceService.

func NewDebugDbResource

func NewDebugDbResource(le *logrus.Entry, b bus.Bus) *DebugDbResource

NewDebugDbResource creates a new DebugDbResource.

func (*DebugDbResource) GetMux

func (r *DebugDbResource) GetMux() srpc.Invoker

GetMux returns the rpc mux.

func (*DebugDbResource) GetStorageInfo

GetStorageInfo returns information about the current storage backend.

func (*DebugDbResource) StartBenchmark

StartBenchmark starts a new benchmark run.

type MetricCollector

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

MetricCollector collects per-operation timing samples for a single metric.

func NewMetricCollector

func NewMetricCollector(name, unit string) *MetricCollector

NewMetricCollector creates a new metric collector.

func (*MetricCollector) Build

Build computes aggregates and returns a BenchmarkMetric.

func (*MetricCollector) MaybeYield

func (m *MetricCollector) MaybeYield()

MaybeYield calls runtime.Gosched if the sample count is a multiple of yieldInterval.

func (*MetricCollector) Record

func (m *MetricCollector) Record(d time.Duration)

Record adds an explicit duration sample.

func (*MetricCollector) Start

func (m *MetricCollector) Start()

Start begins timing an operation.

func (*MetricCollector) Stop

func (m *MetricCollector) Stop()

Stop ends timing and records the sample.

type SuiteTimer

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

SuiteTimer helps run a suite for a target duration.

func NewSuiteTimer

func NewSuiteTimer(totalDuration time.Duration, suiteCount, suiteIndex int) *SuiteTimer

NewSuiteTimer creates a timer for a suite's proportional share of the total duration.

func (*SuiteTimer) Running

func (t *SuiteTimer) Running() bool

Running returns true if the suite still has time remaining.

Jump to

Keyboard shortcuts

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