mba

package
v0.2.2-0...-aec2f31 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GetMbaInfo = func() (int, int, error) {
	step, min := 0, 0
	dat, err := ioutil.ReadFile(proc.MbaInfoPath + "/bandwidth_gran")
	if err != nil {
		return step, min, err
	}
	step, err = strconv.Atoi(strings.TrimSpace(string(dat)))
	if err != nil {
		return step, min, err
	}

	dat, err = ioutil.ReadFile(proc.MbaInfoPath + "/min_bandwidth")
	if err != nil {
		return step, min, err
	}
	min, err = strconv.Atoi(strings.TrimSpace(string(dat)))
	if err != nil {
		return step, min, err
	}
	return step, min, nil
}

GetMbaInfo traverse resctrl MB to get info

Functions

func Get

func Get(request *restful.Request, response *restful.Response)

Get is handler to for GET

func Register

func Register(prefix string, container *restful.Container)

Register add handlers for /v1/mba endpoint

Types

type Info

type Info struct {
	Mba     bool `json:"mba"`
	MbaOn   bool `json:"mba_enable,omitempty"`
	MbaStep int  `json:"mba_step,omitempty"`
	MbaMin  int  `json:"mba_min,omitempty"`
}

Info is the mba information

func (*Info) Get

func (c *Info) Get() error

Get returns mba status

Jump to

Keyboard shortcuts

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