Documentation ¶
Index ¶
- Constants
- Variables
- func ReadTimestamps(bkt *bolt.Bucket, created, updated *time.Time) error
- func RecreateBucket(bkt *bolt.Bucket, key []byte) (*bolt.Bucket, error)
- func ValidateClusterID(id string) error
- func WithTransactionContext(ctx context.Context, tx *bolt.Tx) context.Context
- func WriteTimestamps(bkt *bolt.Bucket, created, updated time.Time) error
- type Benchmark
- type BenchmarkStatus
- type BenchmarkStore
- type Build
- type BuildStore
- type Cluster
- type ClusterDefinition
- type ClusterGroup
- type ClusterStatus
- type ClusterStore
- type DB
- type Experiment
- type ExperimentDefinition
- type ExperimentStatus
- type ExperimentStore
- type Node
- type NodeStore
- type ObjectDefinition
- type ObjectType
- type PeerDefinition
- type Report
- type ReportAggregates
- type ReportBandwidth
- type ReportBitswap
- type ReportNode
- type ReportStore
- type ReportSummary
- type Scenario
- type ScenarioDefinition
- type ScenarioPlan
- type ScenarioStage
- type ScenarioStore
- type Task
- type TaskType
- type TrialDefinition
Constants ¶
const (
ClusterSizeMax = 1000
)
Variables ¶
var (
ClusterIDPattern = regexp.MustCompile(`^[a-zA-Z0-9_-]{1,32}`)
)
var ( DefaultPeerDefinition = PeerDefinition{ GitReference: "HEAD", Transports: []string{"tcp"}, Muxers: []string{"mplex"}, SecurityTransports: []string{"secio"}, Routing: "nil", } )
Functions ¶
func ValidateClusterID ¶
func WithTransactionContext ¶
Types ¶
type Benchmark ¶
type Benchmark struct { ID string Status BenchmarkStatus Cluster Cluster Scenario Scenario Plan ScenarioPlan Labels []string CreatedAt, UpdatedAt time.Time }
type BenchmarkStatus ¶
type BenchmarkStatus string
BenchmarkStatus is the current status of a benchmark.
var ( BenchmarkPlanning BenchmarkStatus = "planning" BenchmarkRunning BenchmarkStatus = "running" BenchmarkDone BenchmarkStatus = "done" BenchmarkError BenchmarkStatus = "error" )
type BenchmarkStore ¶
type BenchmarkStore interface { GetBenchmark(ctx context.Context, id string) (Benchmark, error) ListBenchmarks(ctx context.Context) ([]Benchmark, error) CreateBenchmark(ctx context.Context, benchmark Benchmark) (Benchmark, error) UpdateBenchmark(ctx context.Context, benchmark Benchmark) (Benchmark, error) LabelBenchmarks(ctx context.Context, ids, adds, removes []string) ([]Benchmark, error) DeleteBenchmarks(ctx context.Context, ids ...string) error }
type BuildStore ¶
type Cluster ¶
type Cluster struct { ID string Status ClusterStatus Definition ClusterDefinition Labels []string CreatedAt, UpdatedAt time.Time }
type ClusterDefinition ¶
type ClusterDefinition struct {
Groups []ClusterGroup
}
func (ClusterDefinition) GenerateLabels ¶
func (d ClusterDefinition) GenerateLabels() (labels []string)
func (ClusterDefinition) Size ¶
func (d ClusterDefinition) Size() int
type ClusterGroup ¶
type ClusterGroup struct { Size int InstanceType string Region string Peer *PeerDefinition `json:"peer,omitempty"` Labels []string }
type ClusterStatus ¶
type ClusterStatus string
var ( ClusterCreating ClusterStatus = "creating" ClusterConnecting ClusterStatus = "connecting" ClusterCreated ClusterStatus = "created" ClusterDestroying ClusterStatus = "destroying" ClusterDestroyed ClusterStatus = "destroyed" ClusterError ClusterStatus = "error" )
type ClusterStore ¶
type ClusterStore interface { GetCluster(ctx context.Context, id string) (Cluster, error) ListClusters(ctx context.Context) ([]Cluster, error) CreateCluster(ctx context.Context, cluster Cluster) (Cluster, error) UpdateCluster(ctx context.Context, cluster Cluster) (Cluster, error) LabelClusters(ctx context.Context, ids, adds, removes []string) ([]Cluster, error) DeleteCluster(ctx context.Context, id string) error }
type DB ¶
type DB interface { ClusterStore NodeStore ScenarioStore BuildStore ReportStore BenchmarkStore ExperimentStore View(ctx context.Context, fn func(*bolt.Tx) error) error Update(ctx context.Context, fn func(*bolt.Tx) error) error Close() error }
type Experiment ¶
type Experiment struct { ID string Status ExperimentStatus Definition ExperimentDefinition Reports []Report Labels []string CreatedAt, UpdatedAt time.Time }
func (*Experiment) FromJSON ¶
func (e *Experiment) FromJSON(data []byte) error
FromJSON loads the experiment definition with the values from data
func (*Experiment) ToJSON ¶
func (e *Experiment) ToJSON() ([]byte, error)
ToJSON is a helper function to convert an Experiment into it's JSON representation
type ExperimentDefinition ¶
type ExperimentDefinition struct {
Trials []TrialDefinition
}
ExperimentDefinition defines an experiment.
func (*ExperimentDefinition) FromJSON ¶
func (ed *ExperimentDefinition) FromJSON(data []byte) error
FromJSON loads the experiment definition with the values from data
func (*ExperimentDefinition) ToJSON ¶
func (ed *ExperimentDefinition) ToJSON() ([]byte, error)
ToJSON is a helper function to convert an ExperimentDefinition into it's JSON representation
type ExperimentStatus ¶
type ExperimentStatus string
var ( ExperimentRunning ExperimentStatus = "running" ExperimentDone ExperimentStatus = "done" ExperimentError ExperimentStatus = "error" )
type ExperimentStore ¶
type ExperimentStore interface { GetExperiment(ctx context.Context, id string) (Experiment, error) ListExperiments(ctx context.Context) ([]Experiment, error) CreateExperiment(ctx context.Context, experiment Experiment) (Experiment, error) UpdateExperiment(ctx context.Context, experiment Experiment) (Experiment, error) LabelExperiments(ctx context.Context, ids, adds, removes []string) ([]Experiment, error) DeleteExperiment(ctx context.Context, id string) error }
type NodeStore ¶
type NodeStore interface { GetNode(ctx context.Context, cluster, id string) (Node, error) ListNodes(ctx context.Context, cluster string) ([]Node, error) CreateNode(ctx context.Context, cluster string, node Node) (Node, error) CreateNodes(ctx context.Context, cluster string, node []Node) ([]Node, error) UpdateNode(ctx context.Context, cluster string, node Node) (Node, error) LabelNodes(ctx context.Context, cluster string, ids, adds, removes []string) ([]Node, error) }
type ObjectDefinition ¶
type ObjectDefinition struct { // Type specifies what type is the source of the data and how the data is // retrieved. Types must be one of the following: ["oci-image"]. Type string `json:"type"` Source string `json:"source"` // Layout specify how the DAG is shaped and constructed over the IPLD blocks. Layout string `json:"layout"` // Chunker specify which chunking algorithm to use to chunk the data into IPLD // blocks. Chunker string `json:"chunker"` RawLeaves bool `json:"rawLeaves"` HashFunc string `json:"hashFunc"` MaxLinks int `json:"maxLinks"` }
ObjectDefinition define a type of data that will be distributed during the benchmark. The definition also specify options on how the data is converted into IPFS datastructures.
type ObjectType ¶
type ObjectType string
ObjectType is the type of data retrieved.
var ( // ObjectContainerImage indicates that the object is an OCI image. ObjectContainerImage ObjectType = "oci-image" )
type PeerDefinition ¶
type Report ¶
type Report struct { Summary ReportSummary Aggregates ReportAggregates Nodes map[string]ReportNode Queries map[string][]string }
type ReportAggregates ¶
type ReportAggregates struct {
Totals ReportNode
}
type ReportBandwidth ¶
type ReportBitswap ¶
type ReportNode ¶
type ReportNode struct { Bitswap ReportBitswap Bandwidth ReportBandwidth }
type ReportStore ¶
type ReportSummary ¶
type Scenario ¶
type Scenario struct { ID string Definition ScenarioDefinition Labels []string CreatedAt, UpdatedAt time.Time }
type ScenarioDefinition ¶
type ScenarioDefinition struct { Objects map[string]ObjectDefinition `json:"objects,omitempty"` // Seed map a query to an action. Queries are executed in parallel to seed // a cluster with initial data before running the benchmark. Seed map[string]string `json:"seed,omitempty"` // Benchmark maps a query to an action. Queries are executed in parallel // during the benchmark and metrics are collected during this stage. Benchmark map[string]string `json:"benchmark,omitempty"` }
ScenarioDefinition defines a scenario.
type ScenarioPlan ¶
type ScenarioPlan struct { Objects map[string]cid.Cid Seed ScenarioStage Benchmark ScenarioStage }
type ScenarioStage ¶
type ScenarioStore ¶
type ScenarioStore interface { GetScenario(ctx context.Context, id string) (Scenario, error) ListScenarios(ctx context.Context) ([]Scenario, error) CreateScenario(ctx context.Context, scenario Scenario) (Scenario, error) UpdateScenario(ctx context.Context, scenario Scenario) (Scenario, error) LabelScenarios(ctx context.Context, ids, adds, removes []string) ([]Scenario, error) DeleteScenarios(ctx context.Context, ids ...string) error }
type TrialDefinition ¶
type TrialDefinition struct { Cluster ClusterDefinition `json:"cluster"` Scenario ScenarioDefinition `json:"scenario"` }
TrialDefinition is a grouping of a cluster, and scenario to run together