iodriver

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 1, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NodeDiskDeviceCRSuffix string        = "nodediskdevice"
	NodeDiskIOInfoCRSuffix string        = "nodediskiostats"
	CRNameSpace            string        = "ioi-system"
	DiskIOAnnotation       string        = "blockio.kubernetes.io/resources"
	NodeIOStatusCR         string        = "NodeDiskIOStats"
	APIVersion             string        = "ioi.intel.com/v1"
	PeriodicUpdateInterval time.Duration = 5 * time.Second
	Mi                     float64       = 1024 * 1024
	EmptyDir               DeviceType    = "emptyDir"
	Others                 DeviceType    = "others"
)
View Source
const (
	FakeDeviceID = "fakeDevice"
)

Variables

View Source
var (
	MinDefaultIOBW      resource.Quantity = resource.MustParse("5Mi")
	MinDefaultTotalIOBW resource.Quantity = resource.MustParse("10Mi")

	UpdateBackoff = wait.Backoff{
		Steps:    3,
		Duration: 100 * time.Millisecond,
		Jitter:   1.0,
	}
)
View Source
var BlockSize = []string{"512", "1k", "4k", "8k", "16k", "32k"}

Functions

func EstimateRequest

func EstimateRequest(ioReq string) (*v1alpha1.IOBandwidth, error)

ioRequest example: {"rbps": "30Mi", "wbps": "20Mi", "blocksize": "4k"}

func GetCRName

func GetCRName(n string, suff string) string

func GetSliceIdx

func GetSliceIdx(target string, s []string) int

Types

type Config

type Config struct {
	Kubeconfig string
}

type DeviceType

type DeviceType string

type DiskInfo

type DiskInfo struct {
	Name       string             `json:"name,omitempty"`
	Model      string             `json:"model,omitempty"`
	Vendor     string             `json:"vendor,omitempty"`
	MajorMinor string             `json:"majMin,omitempty"`
	Type       DeviceType         `json:"type,omitempty"`
	MountPoint string             `json:"mountPoint,omitempty"`
	Capacity   string             `json:"capacity,omitempty"`
	TotalBPS   resource.Quantity  `json:"totalBps,omitempty"`
	TotalRBPS  resource.Quantity  `json:"totalRbps,omitempty"`
	TotalWBPS  resource.Quantity  `json:"totalWbps,omitempty"`
	ReadRatio  map[string]float64 `json:"read_ratio,omitempty"`
	WriteRatio map[string]float64 `json:"write_ratio,omitempty"`
}

func GetFakeDevice

func GetFakeDevice() *DiskInfo

type DiskInfos

type DiskInfos struct {
	EmptyDir string
	Info     map[string]*DiskInfo // the map's key is disk id
}

func GetDiskProfile

func GetDiskProfile() *DiskInfos

GetDiskProfile returns the disk profile result with fake device id and fake device info Customize your own profile tool to profile disks

type IODriver

type IODriver struct {
	// contains filtered or unexported fields
}

func NewIODriver

func NewIODriver(cfg Config) (*IODriver, error)

func (*IODriver) AddNodeDiskIOStatsCR

func (c *IODriver) AddNodeDiskIOStatsCR(obj interface{})

func (*IODriver) CreateNodeDiskDeviceCR

func (e *IODriver) CreateNodeDiskDeviceCR(ctx context.Context, c *v1alpha1.NodeDiskDevice) error

func (*IODriver) GetNodeDiskIOStats

func (e *IODriver) GetNodeDiskIOStats(ctx context.Context) (*v1alpha1.NodeDiskIOStats, error)

func (*IODriver) ProcessProfile

func (c *IODriver) ProcessProfile(ctx context.Context, di *DiskInfos) error

get disk profile result and create CR

func (*IODriver) Run

func (c *IODriver) Run(ctx context.Context)

func (*IODriver) UpdateNodeDiskIOInfoStatus

func (e *IODriver) UpdateNodeDiskIOInfoStatus(ctx context.Context, toUpdate map[string]v1alpha1.IOBandwidth) error

func (*IODriver) UpdateNodeDiskIOStatsCR

func (c *IODriver) UpdateNodeDiskIOStatsCR(oldObj, newObj interface{})

func (*IODriver) WatchNodeDiskIOStats

func (c *IODriver) WatchNodeDiskIOStats(ctx context.Context) error

type IORequest

type IORequest struct {
	Rbps      string `json:"rbps"`
	Wbps      string `json:"wbps"`
	BlockSize string `json:"blockSize"`
}

type PodCrInfo

type PodCrInfo struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL