Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultAttributes = map[string]interface{}{ "name": []string{"name"}, "role": []string{"role"}, "roles": []string{"roles"}, "environment": []string{"chef_environment"}, "ipaddress": []string{"ipaddress"}, "ec2.public_ipv4": []string{"ec2", "public_ipv4"}, "ec2.local_ipv4": []string{"ec2", "local_ipv4"}, "ec2.placement_availability_zone": []string{"ec2", "placement_availability_zone"}, "cloud.private_ips": []string{"cloud", "private_ips"}, "cloud.public_ips": []string{"cloud", "public_ips"}, "cloud.provider": []string{"cloud", "provider"}, "cloud.public_ip": []string{"cloud", "public_ip"}, "cloud.private_ip": []string{"cloud", "private_ip"}, }
DefaultAttributes is the default set of attributes to pull from the ChefServer for stress testing. This is just a random assortment of node data.
var DefaultQueries = []string{"roles:*", "name:*"}
DefaultQueries is a default set of queries to run when stress testing.
Functions ¶
This section is empty.
Types ¶
type ChefConfig ¶
ChefConfig is a struct that contains all the items we need to build a *chef.Client.
type StressResult ¶
StressResult is a struct that contains the information for a single Search result (Partial or Full).
The ID filed is the auto-incremented ID of which goroutine this was, this allows you to know whether it was an earlier or later goroutine.
type StressResults ¶
type StressResults struct { Fastest *StressResult Slowest *StressResult Average float64 Results []*StressResult }
StressResults is the entire resultset for the stressin gof the Chef server. The field names should be pretty self-explanatory.
func PartialSearch ¶
func PartialSearch(config ChefConfig, concurrency int, queries []string, attributes map[string]interface{}) *StressResults
PartialSearch is a function to execute a partial search using the attributes param. The provided concurrency is how many concurrent queries you want. The queries parameter is a slice of possible queries to run. The attributes parameter is are the attributes for the partial search. Each entry in the map is usually a []string. This function does not loop and only does one invocation of n queries.
If multiple queries are provided a random query is used per invocation.
func Search ¶
func Search(config ChefConfig, concurrency int, queries []string) *StressResults
Search is a function to execute a full search where all node attributes are returned. The provided concurrency param is how many concurrent queries you want. The queries parameter is a slice of possible queries to run. This function does not loop and only does one invocation of n queries.
If multiple queries are provided a random query is used per invocation.
type Stresser ¶
type Stresser struct { Queries []string Attributes map[string]interface{} Config ChefConfig }
Stresser is a struct for easily running different stress tests against the Chef server. The Queries field is a slice of queries to run against the Chef server, with one being picked randomly for each search. The Attributes field is the field required if you want to use PartialSearch. Each item in the map is usually a []string.
func (*Stresser) PartialSearch ¶
func (s *Stresser) PartialSearch(concurrency int) *StressResults
PartialSearch is a function to execute a partial search using the Attributes field. The provided parameter is how many concurrent queries you want. This function wraps PartialSearch().
func (*Stresser) Search ¶
func (s *Stresser) Search(concurrency int) *StressResults
Search is a function to execute a full search. The provided parameter is how many concurrent queries you want. This function wraps Search().