blockdev

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MetadataDecoder

func MetadataDecoder(raw json.RawMessage) (getter.Getter, error)

MetadataDecoder implements a json message raw decoder

func MetricDecoder

func MetricDecoder(raw json.RawMessage) (getter.Getter, error)

MetricDecoder implements a json message raw decoder

func NewProbe

func NewProbe(ctx tp.Context, bundle *probe.Bundle) (probe.Handler, error)

NewProbe initializes a new topology blockdev probe

func Register

func Register()

Register registers graph metadata decoders

Types

type BlockDevice

type BlockDevice struct {
	Children []BlockDevice `mapstructure:"children"`

	Alignment    int64  `mapstructure:"alignment"`
	DiscAln      int64  `mapstructure:"disc-aln"`
	DiscGran     string `mapstructure:"disc-gran"`
	DiscMax      string `mapstructure:"disc-max"`
	DiscZero     bool   `mapstructure:"disc-zero"`
	Fsavail      string `mapstructure:"fsavail"`
	Fssize       string `mapstructure:"fssize"`
	Fstype       string `mapstructure:"fstype"`
	FsusePercent string `mapstructure:"fsuse%"`
	Fsused       string `mapstructure:"fsused"`
	Group        string `mapstructure:"group"`
	Hctl         string `mapstructure:"hctl"`
	Hotplug      bool   `mapstructure:"hotplug"`
	Kname        string `mapstructure:"kname"`
	Label        string `mapstructure:"label"`
	LogSec       int64  `mapstructure:"log-sec"`
	MajMin       string `mapstructure:"maj:min"`
	MinIo        int64  `mapstructure:"min-io"`
	Mode         string `mapstructure:"mode"`
	Model        string `mapstructure:"model"`
	Mountpoint   string `mapstructure:"mountpoint"`
	Name         string `mapstructure:"name"`
	OptIo        int64  `mapstructure:"opt-io"`
	Owner        string `mapstructure:"owner"`
	Partflags    string `mapstructure:"partflags"`
	Partlabel    string `mapstructure:"partlabel"`
	Parttype     string `mapstructure:"parttype"`
	Partuuid     string `mapstructure:"partuuid"`
	Path         string `mapstructure:"path"`
	PhySec       int64  `mapstructure:"hpy-sec"`
	Pkname       string `mapstructure:"pkname"`
	Pttype       string `mapstructure:"pttype"`
	Ptuuid       string `mapstructure:"ptuuid"`
	Ra           int64  `mapstructure:"ra"`
	Rand         bool   `mapstructure:"rand"`
	Rev          string `mapstructure:"rev"`
	Rm           bool   `mapstructure:"rm"`
	Ro           bool   `mapstructure:"ro"`
	Rota         bool   `mapstructure:"rota"`
	RqSize       int64  `mapstructure:"rq-size"`
	Sched        string `mapstructure:"sched"`
	Serial       string `mapstructure:"serial"`
	Size         string `mapstructure:"size"`
	State        string `mapstructure:"state"`
	Subsystems   string `mapstructure:"subsystems"`
	Tran         string `mapstructure:"tran"`
	Type         string `mapstructure:"type"`
	UUID         string `mapstructure:"uuid"`
	Vendor       string `mapstructure:"vendor"`
	Wsame        string `mapstructure:"wsame"`
	WWN          string `mapstructure:"wwn"`
}

BlockDevice used for JSON parsing

type BlockDeviceAttrs

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

BlockDeviceAttrs use to hold IO stats for a block device

type BlockMetric

type BlockMetric struct {
	ReadsPerSec        int64 `json:"ReadsPerSec,omitempty"`
	WritesPerSec       int64 `json:"WritesPerSec,omitempty"`
	ReadsKBPerSec      int64 `json:"ReadsKBPerSec,omitempty"`
	WritesKBPerSec     int64 `json:"WritesKBPerSec,omitempty"`
	ReadsMergedPerSec  int64 `json:"ReadsMergedPerSec,omitempty"`
	WritesMergedPerSec int64 `json:"WritesMergedPerSec,omitempty"`
	ReadsMerged        int64 `json:"ReadsMerged,omitempty"`
	WritesMerged       int64 `json:"WritesMerged,omitempty"`
	ReadServiceTime    int64 `json:"ReadServiceTime,omitempty"`
	WriteServiceTime   int64 `json:"WriteServiceTime,omitempty"`
	AverageQueueSize   int64 `json:"AverageQueueSize,omitempty"`
	AverageReadSize    int64 `json:"AverageReadSize,omitempty"`
	AverageWriteSize   int64 `json:"AverageWriteSize,omitempty"`
	ServiceTime        int64 `json:"ServiceTime,omitempty"`
	Utilization        int64 `json:"Utilization,omitempty"`
	Start              int64 `json:"Start,omitempty"`
	Last               int64 `json:"Last,omitempty"`
}

BlockMetric container for the blockdevice IO stats easyjson:json gendecoder

func (*BlockMetric) GetField

func (obj *BlockMetric) GetField(key string) (interface{}, error)

func (*BlockMetric) GetFieldBool

func (obj *BlockMetric) GetFieldBool(key string) (bool, error)

func (*BlockMetric) GetFieldInt64

func (obj *BlockMetric) GetFieldInt64(key string) (int64, error)

func (*BlockMetric) GetFieldKeys

func (obj *BlockMetric) GetFieldKeys() []string

func (*BlockMetric) GetFieldString

func (obj *BlockMetric) GetFieldString(key string) (string, error)

func (BlockMetric) MarshalEasyJSON

func (v BlockMetric) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (BlockMetric) MarshalJSON

func (v BlockMetric) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*BlockMetric) MatchBool

func (obj *BlockMetric) MatchBool(key string, predicate getter.BoolPredicate) bool

func (*BlockMetric) MatchInt64

func (obj *BlockMetric) MatchInt64(key string, predicate getter.Int64Predicate) bool

func (*BlockMetric) MatchString

func (obj *BlockMetric) MatchString(key string, predicate getter.StringPredicate) bool

func (*BlockMetric) UnmarshalEasyJSON

func (v *BlockMetric) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*BlockMetric) UnmarshalJSON

func (v *BlockMetric) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Devices

type Devices struct {
	Blockdevices []BlockDevice `mapstructure:"blockdevices"`
}

Devices used for JSON parsing

type IOMetric

type IOMetric struct {
	ReadsPerSec        int64 `mapstructure:"r/s,omitempty"`
	WritesPerSec       int64 `mapstructure:"w/s,omitempty"`
	ReadsKBPerSec      int64 `mapstructure:"rkB/s,omitempty"`
	WritesKBPerSec     int64 `mapstructure:"wkB/s,omitempty"`
	ReadsMergedPerSec  int64 `mapstructure:"rrqm/s,omitempty"`
	WritesMergedPerSec int64 `mapstructure:"wrqm/s,omitempty"`
	ReadsMerged        int64 `mapstructure:"rrqm,omitempty"`
	WritesMerged       int64 `mapstructure:"wrqm,omitempty"`
	ReadServiceTime    int64 `mapstructure:"r_await,omitempty"`
	WriteServiceTime   int64 `mapstructure:"w_await,omitempty"`
	AverageQueueSize   int64 `mapstructure:"aqu-sz,omitempty"`
	AverageReadSize    int64 `mapstructure:"rareq-sz,omitempty"`
	AverageWriteSize   int64 `mapstructure:"wareq-sz,omitempty"`
	ServiceTime        int64 `mapstructure:"svctm,omitempty"`
	Utilization        int64 `mapstructure:"util,omitempty"`
	Start              int64 `mapstructure:"Start,omitempty"`
	Last               int64 `mapstructure:"Last,omitempty"`
}

IOMetric used for parsing the output of iostat

func (*IOMetric) MakeCopy

func (im *IOMetric) MakeCopy() *BlockMetric

MakeCopy is used to copy an IOMetric to a Metric

type Metadata

type Metadata struct {
	Index        string
	Name         string
	Alignment    int64
	DiscAln      int64
	DiscGran     string
	DiscMax      string
	DiscZero     bool
	Fsavail      string
	Fssize       string
	Fstype       string
	FsusePercent string
	Fsused       string
	Group        string
	Hctl         string
	Hotplug      bool
	Kname        string
	Label        string
	LogSec       int64
	MajMin       string
	MinIo        int64
	Mode         string
	Model        string
	Mountpoint   string
	OptIo        int64
	Owner        string
	Partflags    string
	Partlabel    string
	Parttype     string
	Partuuid     string
	Path         string
	PhySec       int64
	Pkname       string
	Pttype       string
	Ptuuid       string
	Ra           int64
	Rand         bool
	Rev          string
	Rm           bool
	Ro           bool
	Rota         bool
	RqSize       int64
	Sched        string
	Serial       string
	Size         string
	State        string
	Subsystems   string
	Tran         string
	Type         string
	UUID         string
	Vendor       string
	Wsame        string
	WWN          string
	Labels       graph.Metadata `field:"Metadata"`
}

Metadata describe the metadata of a block device easyjson:json gendecoder

func (*Metadata) GetField

func (obj *Metadata) GetField(key string) (interface{}, error)

func (*Metadata) GetFieldBool

func (obj *Metadata) GetFieldBool(key string) (bool, error)

func (*Metadata) GetFieldInt64

func (obj *Metadata) GetFieldInt64(key string) (int64, error)

func (*Metadata) GetFieldKeys

func (obj *Metadata) GetFieldKeys() []string

func (*Metadata) GetFieldString

func (obj *Metadata) GetFieldString(key string) (string, error)

func (Metadata) MarshalEasyJSON

func (v Metadata) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (Metadata) MarshalJSON

func (v Metadata) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*Metadata) MatchBool

func (obj *Metadata) MatchBool(key string, predicate getter.BoolPredicate) bool

func (*Metadata) MatchInt64

func (obj *Metadata) MatchInt64(key string, predicate getter.Int64Predicate) bool

func (*Metadata) MatchString

func (obj *Metadata) MatchString(key string, predicate getter.StringPredicate) bool

func (*Metadata) UnmarshalEasyJSON

func (v *Metadata) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*Metadata) UnmarshalJSON

func (v *Metadata) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type ProbeHandler

type ProbeHandler struct {
	insanelock.RWMutex
	Ctx tp.Context

	Groups map[string]*graph.Node
	// contains filtered or unexported fields
}

ProbeHandler describes a block device graph that enhances the graph

func (*ProbeHandler) Do

func (p *ProbeHandler) Do(ctx context.Context, wg *sync.WaitGroup) error

Do adds a group for block devices, then issues a lsblk command and parsers the JSON output as a basis for the blockdev links.

Jump to

Keyboard shortcuts

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