...

Package ipamperf

import "k8s.io/kubernetes/test/integration/ipamperf"
Overview
Index

Overview ▾

type Config

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
}

type JSONDuration

JSONDuration is an alias of time.Duration to support custom Marshal code

type JSONDuration time.Duration

func (*JSONDuration) MarshalJSON

func (jDuration *JSONDuration) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface

func (*JSONDuration) UnmarshalJSON

func (jDuration *JSONDuration) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON implements the json.Unmarshaler interface

type NodeDuration

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
}

type Observer

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

func NewObserver(clientSet *clientset.Clientset, numNodes int) *Observer

NewObserver creates a new observer given a handle to the Clientset

func (*Observer) Results

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 (*Observer) StartObserving

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.

type Results

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) String

func (results *Results) String() string

String implements the Stringer interface and returns a multi-line representation of the test results.