Config represents the test configuration that is being run
type Config struct { CreateQPS int // rate at which nodes are created KubeQPS int // rate for communication with kubernetes API CloudQPS int // rate for communication with cloud endpoint NumNodes int // number of nodes to created and monitored AllocatorType ipam.CIDRAllocatorType // type of allocator to run Cloud cloudprovider.Interface // cloud provider }
JSONDuration is an alias of time.Duration to support custom Marshal code
type JSONDuration time.Duration
func (jDuration *JSONDuration) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface
func (jDuration *JSONDuration) UnmarshalJSON(b []byte) (err error)
UnmarshalJSON implements the json.Unmarshaler interface
NodeDuration represents the CIDR allocation time for each node
type NodeDuration struct { Name string // node name PodCIDR string // the podCIDR that was assigned to the node Duration JSONDuration // how long it took to assign podCIDR }
Observer represents the handle to test observer that watches for node changes and tracks behavior
type Observer struct {
// contains filtered or unexported fields
}
func NewObserver(clientSet *clientset.Clientset, numNodes int) *Observer
NewObserver creates a new observer given a handle to the Clientset
func (o *Observer) Results(name string, config *Config) *Results
Results returns the test results. It waits for the observer to finish and returns the computed results of the observations.
func (o *Observer) StartObserving() error
StartObserving starts an asynchronous loop to monitor for node changes. Call Results() to get the test results after starting observer.
Results represents the observed test results.
type Results struct { Name string // name for the test Config *Config // handle to the test config Succeeded bool // whether all nodes were assigned podCIDR MaxAllocTime JSONDuration // the maximum time take for assignment per node TotalAllocTime JSONDuration // duration between first addition and last assignment NodeAllocTime []NodeDuration // assignment time by node name }
func (results *Results) String() string
String implements the Stringer interface and returns a multi-line representation of the test results.