Help us shape the future of Go! Take the 2026 Go Developer Survey

mba

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2021 License: Apache-2.0 Imports: 6 Imported by: 1

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