Documentation
¶
Overview ¶
Package plugin provides the core plugin interface and registry for benchmark tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalParams ¶
MarshalParams converts Params to JSON
func Register ¶
func Register(plugin TestPlugin) error
Register adds a plugin to the global registry
Types ¶
type Info ¶
type Info struct {
Name string `json:"name"`
Description string `json:"description"`
Category string `json:"category"`
Metrics []MetricInfo `json:"metrics"`
Parameters []ParamInfo `json:"parameters"`
}
Info provides metadata about a plugin
func GetPluginInfo ¶
func GetPluginInfo() []Info
GetPluginInfo returns detailed information about all registered plugins
type MetricInfo ¶
type MetricInfo struct {
Name string `json:"name"`
Type MetricType `json:"type"`
Unit string `json:"unit"`
Description string `json:"description"`
}
MetricInfo provides metadata about a metric
type MetricType ¶
type MetricType string
MetricType represents the type of a metric
const ( MetricTypeGauge MetricType = "gauge" // Point-in-time value MetricTypeCounter MetricType = "counter" // Cumulative value MetricTypeThroughput MetricType = "throughput" // Rate per second MetricTypeLatency MetricType = "latency" // Time measurement )
MetricType constants define the different types of metrics that can be collected.
type ParamInfo ¶
type ParamInfo struct {
Name string `json:"name"`
Type string `json:"type"`
Default interface{} `json:"default"`
Description string `json:"description"`
Required bool `json:"required"`
}
ParamInfo describes a parameter that a plugin accepts
type Params ¶
type Params struct {
// Common parameters
Duration time.Duration `json:"duration"`
Threads int `json:"threads"`
Config map[string]interface{} `json:"config"`
}
Params represents parameters passed to a test plugin
func UnmarshalParams ¶
UnmarshalParams converts JSON to Params
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages all available test plugins
func (*Registry) Get ¶
func (r *Registry) Get(name string) (TestPlugin, error)
Get retrieves a plugin by name
func (*Registry) GetAll ¶
func (r *Registry) GetAll() map[string]TestPlugin
GetAll returns all registered plugins
func (*Registry) GetPluginInfo ¶
GetPluginInfo returns detailed information about all plugins
func (*Registry) Register ¶
func (r *Registry) Register(plugin TestPlugin) error
Register adds a plugin to the registry
type Result ¶
type Result struct {
// Timing information
StartTime time.Time `json:"start_time"`
EndTime time.Time `json:"end_time"`
Duration time.Duration `json:"duration"`
// Test results
Success bool `json:"success"`
Error string `json:"error,omitempty"`
Metrics map[string]float64 `json:"metrics"`
Details map[string]interface{} `json:"details,omitempty"`
// Raw output
Stdout string `json:"stdout,omitempty"`
Stderr string `json:"stderr,omitempty"`
}
Result represents the output of a test plugin
type TestPlugin ¶
type TestPlugin interface {
// Name returns the unique name of the plugin
Name() string
// Description returns a human-readable description
Description() string
// Run executes the test with the given parameters
Run(ctx context.Context, params Params) (Result, error)
// ValidateParams checks if the parameters are valid for this plugin
ValidateParams(params Params) error
// DefaultParams returns the default parameters for this plugin
DefaultParams() Params
}
TestPlugin is the interface that all test plugins must implement
func Get ¶
func Get(name string) (TestPlugin, error)
Get retrieves a plugin from the global registry
Directories
¶
| Path | Synopsis |
|---|---|
|
Package cpu provides CPU benchmarking and stress testing functionality.
|
Package cpu provides CPU benchmarking and stress testing functionality. |
|
Package memory provides memory stress testing and bandwidth measurement plugins for FIRE.
|
Package memory provides memory stress testing and bandwidth measurement plugins for FIRE. |