src

package
v0.0.0-...-8d05fb3 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2019 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Created by kenenbek on 18.12.17.

Created by kenenbek on 16.12.17.

Created by kenenbek on 16.12.17.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiskReaderExecutor

func DiskReaderExecutor(TP *SANProcess, data interface{})

func FORK

func FORK(name string, f SANBFunction, host *lib.Host, data interface{})

func PIDecorator

func PIDecorator(function SANBFunction) lib.BaseBehaviourFunction

func ParseFileAndUnmarshal

func ParseFileAndUnmarshal(filename string) []byte

func SimParallelization

func SimParallelization(filename string) map[int]float64

func StartSimulation

func StartSimulation(flags *lib.SystemFlags)

Types

type ClientManager

type ClientManager struct {
	*lib.Host `json:"-"`

	Cap float64 `json:"cap"`
	// contains filtered or unexported fields
}

func NewClientManager

func NewClientManager(host *lib.Host, iob *IOBalancer, id string, capacity float64,
	parMap map[int]float64) *ClientManager

func (*ClientManager) DecreaseIOCNT

func (CL *ClientManager) DecreaseIOCNT()

func (*ClientManager) IOBalancerReadCounterProcess

func (CL *ClientManager) IOBalancerReadCounterProcess(TP *SANProcess, _ interface{})

func (*ClientManager) IOBalancerWriteCounterProcess

func (CL *ClientManager) IOBalancerWriteCounterProcess(TP *SANProcess, _ interface{})

func (*ClientManager) PacketSenderReceiverProcess

func (CL *ClientManager) PacketSenderReceiverProcess(TP *SANProcess, data interface{})

func (*ClientManager) ReceivePacket

func (CL *ClientManager) ReceivePacket(TP *SANProcess, info *FileInfo) lib.STATUS

func (*ClientManager) SendPacket

func (CL *ClientManager) SendPacket(TP *SANProcess, info *FileInfo) lib.STATUS

func (*ClientManager) Tracer

func (CL *ClientManager) Tracer(TP *SANProcess, _ interface{})

func (*ClientManager) WriteProcessRestart

func (CL *ClientManager) WriteProcessRestart(fileInfo *FileInfo)

type CommonProps

type CommonProps struct {
	Status  anomaly.ComponentStatus `json:"health"`
	DevTemp float64                 `json:"dev_temp"`
	Uptime  float64                 `json:"uptime"`
}

type Controller

type Controller struct {
	*Mock
	*NamingProps
	*ControllerProps `json:"props"`
	*lib.Host        `json:"-"`
	*SANComponent    `json:"-"`
	// contains filtered or unexported fields
}

func NewController

func NewController(host *lib.Host) *Controller

func (*Controller) ExecutePacket

func (controller *Controller) ExecutePacket(TP *SANProcess, packet *lib.Packet, fi *FileInfo) lib.STATUS

func (*Controller) ReceivePacket

func (controller *Controller) ReceivePacket(TP *SANProcess, address string) (*lib.Packet, lib.STATUS)

func (*Controller) ResetDiffValues

func (controller *Controller) ResetDiffValues()

func (*Controller) SendPacket

func (controller *Controller) SendPacket(TP *SANProcess, packet *lib.Packet, address string) lib.STATUS

func (*Controller) ServerExecutor

func (controller *Controller) ServerExecutor(TP *SANProcess, data interface{})

type ControllerProps

type ControllerProps struct {
	*CommonProps
	LastTime float64 `json:"-"`

	TrafficDif       float64 `json:"traffic"`
	TrafficCum       float64 `json:"-"`
	InputTrafficDif  float64 `json:"-"`
	OutputTrafficDif float64 `json:"-"`
	InputTrafficCum  float64 `json:"-"`
	OutputTrafficCum float64 `json:"-"`

	FlopsExecutedDiff float64 `json:"load"`
	FlopsExecutedCum  float64 `json:"-"`
}

type DiskState

type DiskState struct {
	Pool       string `json:"pool"`
	TotalSpace uint64 `json:"total_cap_MB"` // TODO
	UsedSpace  uint64 `json:"used_cap_MB"`  // TODO
	AllocMB    uint64 `json:"alloc_MB"`     // TODO
	LenMB      uint64 `json:"len_MB"`       // TODO
	Status     string `json:"status"`       // TODO
	State      string `json:"state"`        // TODO

	AvgReadSpeed  float64     `json:"r_KBps"` // TODO `json:"avg_read_speed"`
	AvgWriteSpeed float64     `json:"w_KBps"` // TODO `json:"avg_write_speed"`
	ReadOps       float64     `json:"r_ops"`
	WriteOps      float64     `json:"w_ops"`
	ReadAwaitMs   float64     `json:"r_await_ms"`
	WriteAwaitMs  float64     `json:"w_await_ms"`
	Crrm          float64     `json:"crrm"`     // TODO
	Rrqm          float64     `json:"rrqm"`     // TODO
	Wrqm          float64     `json:"wrqm"`     // TODO
	Avgrq_sz      float64     `json:"avgrq_sz"` // TODO NZ
	Avgqu_sz      float64     `json:"avgqu_sz"` // TODO NZ
	MBRead        float64     `json:"MB_read"`
	MBWrtn        float64     `json:"MB_wrtn"`
	IORead        [10]float64 `json:"blk_read"`
	IOWrite       [10]float64 `json:"blk_write"`

	// unnecessary
	Async   float64 `json:"async"`
	Crrq    float64 `json:"crrq"`
	AvgQsz  float64 `json:"avg_qsz"`
	SvctmMs float64 `json:"svctm_ms"`
}

func NewDiskState

func NewDiskState() *DiskState

func (*DiskState) ResetDiffValues

func (ds *DiskState) ResetDiffValues()

type FileInfo

type FileInfo struct {
	*lib.File
	// contains filtered or unexported fields
}

func NewFileInfo

func NewFileInfo(file *lib.File, con *Controller, jbod *SANJBODController) *FileInfo

type FileMetric

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

type IOBalancer

type IOBalancer struct {
	*NamingProps
	*IOBalancerProps `json:"props"`
	*lib.Host        `json:"-"`
	*SANComponent    `json:"-"`
	GlobalDiskState  *DiskState `json:"-"`

	Controllers []*Controller        `json:"-"`
	Jbods       []*SANJBODController `json:"-"`

	FailManager *AtmosphereFailManager `json:"-"`
	// contains filtered or unexported fields
}

func NewIOBalancer

func NewIOBalancer(host *lib.Host, cons []*Controller, jbods []*SANJBODController) *IOBalancer

func (*IOBalancer) AddWorkingController

func (iob *IOBalancer) AddWorkingController(controller *Controller)

func (*IOBalancer) CreateSANExecutors

func (iob *IOBalancer) CreateSANExecutors(file *lib.File) *FileInfo

func (*IOBalancer) CreateSANReaderExecutors

func (iob *IOBalancer) CreateSANReaderExecutors(file *lib.File) *FileInfo

func (*IOBalancer) CreateSANWriterExecutors

func (iob *IOBalancer) CreateSANWriterExecutors(file *lib.File) *FileInfo

func (*IOBalancer) GetControllerById

func (iob *IOBalancer) GetControllerById(conId string) *Controller

func (*IOBalancer) GetDiskById

func (iob *IOBalancer) GetDiskById(diskId string) *SANDisk

func (*IOBalancer) GetJbodConById

func (iob *IOBalancer) GetJbodConById(jbodId string) *SANJBODController

func (*IOBalancer) GetLinkById

func (iob *IOBalancer) GetLinkById(linkId string) *SANLink

func (*IOBalancer) GetWorkingComponents

func (iob *IOBalancer) GetWorkingComponents() (*Controller, *SANJBODController)

func (*IOBalancer) GetWorkingController

func (iob *IOBalancer) GetWorkingController() *Controller

func (*IOBalancer) GetWorkingJBOD

func (iob *IOBalancer) GetWorkingJBOD() *SANJBODController

func (*IOBalancer) IOBalancerProcessManager

func (iob *IOBalancer) IOBalancerProcessManager(TP *SANProcess, data interface{})

func (*IOBalancer) RemoveWorkingController

func (iob *IOBalancer) RemoveWorkingController(index int)

func (*IOBalancer) ResetDiffValues

func (iob *IOBalancer) ResetDiffValues()

func (*IOBalancer) SANComponentsPreparation

func (iob *IOBalancer) SANComponentsPreparation(file *lib.File) (*FileInfo, *Controller, *SANJBODController)

type IOBalancerFManager

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

type IOBalancerProps

type IOBalancerProps struct {
	*CommonProps
	ReadResponseRate        float64 `json:"read_response_rate"`
	WriteResponseRate       float64 `json:"write_response_rate"`
	ReadRequestsRate        float64 `json:"read_requests_rate"`
	WriteRequestsRate       float64 `json:"write_requests_rate"`
	ReadDataVolume          float64 `json:"read_data_volume"`
	WriteDataVolume         float64 `json:"write_data_volume"`
	ReadRequestProcessTime  float64 `json:"read_request_process_time"`
	WriteRequestProcessTime float64 `json:"write_request_process_time"`
	IoProcessingMethod      uint8   `json:"io_processing_method"`
	ReadCancelRate          float64 `json:"read_cancel_rate"`
	WriteCancelRate         float64 `json:"write_cancel_rate"`
	BlockSize               uint16  `json:"block_size"`
	IOProcessCnt            uint8   `json:"io_process_cnt"`
	ReadQueueLength         uint8   `json:"read_queue_length"`
	WriteQueueLength        uint8   `json:"write_queue_length"`
}

type LogJson

type LogJson struct {
	Timestamp         float64            `json:"timestamp"`
	Ambience          *AtmosphereControl `json:"ambience"`
	StorageComponents []TraceAble        `json:"storage_components"`
	StState           *DiskState         `json:"storage_state"`
}

func CreateLogJSON

func CreateLogJSON(hosts []TraceAble, jbods []*SANJBODController, ACM *AtmosphereControlManager) *LogJson

type Master

type Master struct {
	*lib.Host
	// contains filtered or unexported fields
}

func NewMaster

func NewMaster(host *lib.Host, clients map[int]*ClientManager) *Master

func (*Master) ClientManagerAsyncProcess

func (M *Master) ClientManagerAsyncProcess(TP *SANProcess, data interface{})

type Mock

type Mock struct {
}

func (*Mock) Break

func (m *Mock) Break(*lib.Process, float64, float64)

func (*Mock) Repair

func (m *Mock) Repair(*lib.Process, float64)

func (*Mock) Reset

func (m *Mock) Reset()

func (*Mock) Update

func (m *Mock) Update(map[string]float64)

type NamingProps

type NamingProps struct {
	Type  string `json:"type"`
	Name  string `json:"-"`
	ID    string `json:"id"`
	Owner string `json:"owner"`
}

func NewNamingProps

func NewNamingProps(name, typeID, id string) *NamingProps

type SAN

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

func (*SAN) GetClientManager

func (t *SAN) GetClientManager() *ClientManager

func (*SAN) GetControllers

func (t *SAN) GetControllers() []*Controller

func (*SAN) GetDeepControllerManager

func (t *SAN) GetDeepControllerManager() *deepcontroller.Manager

func (*SAN) GetIoBalancer

func (t *SAN) GetIoBalancer() *IOBalancer

func (*SAN) GetJsonLog

func (t *SAN) GetJsonLog() *LogJson

func (*SAN) GetSANJBODControllers

func (t *SAN) GetSANJBODControllers() []*SANJBODController

func (*SAN) Read

func (t *SAN) Read()

func (*SAN) Save

func (t *SAN) Save()

func (*SAN) Write

func (t *SAN) Write()

type SANBFunction

type SANBFunction func(*SANProcess, interface{})

type SANBuilder

type SANBuilder interface {
	IOBalancer(*IOBalancer) SANBuilder
	Controllers([]*Controller) SANBuilder
	JbodControllers([]*SANJBODController) SANBuilder
	Client(*ClientManager) SANBuilder
	Tracer(*TracerManager) SANBuilder
	AtmosphereControl(*AtmosphereControlManager) SANBuilder
	Build() SHD
}

func NewSAN

func NewSAN() SANBuilder

type SANComponent

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

func (*SANComponent) GetCurrentState

func (component *SANComponent) GetCurrentState() string

func (*SANComponent) SetCurrentState

func (component *SANComponent) SetCurrentState(state string)

type SANDisk

type SANDisk struct {
	*Mock
	*NamingProps
	*StorageProperties `json:"props"`
	*lib.Storage       `json:"-"`
	*SANComponent      `json:"-"`
	GlobalDiskState    *DiskState `json:"-"`
	// contains filtered or unexported fields
}

func NewSANDisk

func NewSANDisk(libDisk *lib.Storage, jbod *SANJBODController) *SANDisk

func (*SANDisk) DiskWriterManagerProcess

func (disk *SANDisk) DiskWriterManagerProcess(TP *SANProcess, data interface{})

func (*SANDisk) MetricRead

func (disk *SANDisk) MetricRead(packet *lib.Packet)

func (*SANDisk) MetricWrite

func (disk *SANDisk) MetricWrite(packet *lib.Packet)

func (*SANDisk) ReadAsync

func (disk *SANDisk) ReadAsync(TP *SANProcess, packet *lib.Packet) (*lib.Packet, lib.STATUS)

func (*SANDisk) ReadSync

func (disk *SANDisk) ReadSync(TP *SANProcess, packet *lib.Packet) (*lib.Packet, lib.STATUS)

func (*SANDisk) ResetDiffValues

func (disk *SANDisk) ResetDiffValues()

func (*SANDisk) WriteAsync

func (disk *SANDisk) WriteAsync(TP *SANProcess, packet *lib.Packet) lib.STATUS

func (*SANDisk) WriteSync

func (disk *SANDisk) WriteSync(TP *SANProcess, packet *lib.Packet) lib.STATUS

type SANJBODController

type SANJBODController struct {
	*lib.Host     `json:"-"`
	*NamingProps  `json:"-"`
	*CommonProps  `json:"-"`
	*SANComponent `json:"-"`
	// contains filtered or unexported fields
}

func NewSANJBODController

func NewSANJBODController(libJBOD *lib.JBOD) *SANJBODController

JBOD name matches with the name of its controller

func (*SANJBODController) GetDisks

func (tjc *SANJBODController) GetDisks() []*SANDisk

func (*SANJBODController) GetPacketLocation

func (jbod *SANJBODController) GetPacketLocation(packet *lib.Packet) *SANDisk

func (*SANJBODController) GetWorkingDisk

func (tjc *SANJBODController) GetWorkingDisk() *SANDisk

func (*SANJBODController) JbodReaderProcess

func (jbod *SANJBODController) JbodReaderProcess(TP *SANProcess, data interface{})

func (*SANJBODController) JbodWriterProcess

func (jbod *SANJBODController) JbodWriterProcess(TP *SANProcess, data interface{})
type SANLink struct {
	*Mock
	*NamingProps
	*lib.Link     `json:"-"`
	*SANComponent `json:"-"`
	// contains filtered or unexported fields
}

type SANProcess

type SANProcess struct {
	*lib.Process
}

func NewSANProcess

func NewSANProcess() *SANProcess

func (*SANProcess) GetParent

func (tp *SANProcess) GetParent() *lib.Process

func (*SANProcess) SendToHost

func (TP *SANProcess) SendToHost(controller *Controller, packet *lib.Packet) lib.STATUS

func (*SANProcess) SetParent

func (tp *SANProcess) SetParent(p *lib.Process)

type SANVolume

type SANVolume struct {
	*NamingProps
	*StorageProperties `json:"props"`
	*SANComponent      `json:"-"`
	// contains filtered or unexported fields
}

func NewSANVolume

func NewSANVolume(libVolume *lib.Volume) *SANVolume

func NewUnifiedLogicalVolume

func NewUnifiedLogicalVolume(jbods []*SANJBODController) *SANVolume

func (*SANVolume) ResetDiffValues

func (volume *SANVolume) ResetDiffValues()

type SHD

type SHD interface {
	Read()
	Write()
	Save()

	GetControllers() []*Controller
	GetClientManager() *ClientManager
	GetIoBalancer() *IOBalancer
	GetSANJBODControllers() []*SANJBODController

	GetJsonLog() *LogJson
	GetDeepControllerManager() *deepcontroller.Manager
}

func PlatformInit

func PlatformInit(flags *lib.SystemFlags) SHD

type StorageProperties

type StorageProperties struct {
	*CommonProps
	RawCapacity       float64 `json:"cap_gb"`
	Type              string  `json:"type"`
	JBOD              string  `json:"jbod"`
	Pool              string  `json:"pool"`
	AvgReadSpeed      float64 `json:"-"` // `json:"avg_read_speed"`
	AvgWriteSpeed     float64 `json:"-"` // `json:"avg_write_speed"`
	DataInterfacesCnt uint16  `json:"-"` // `json:"data_interfaces_cnt"`
	UsedSpace         float64 `json:"-"` // `json:"used_space"`
	FreeSpace         float64 `json:"-"` // `json:"free_space"`
}

type TraceAble

type TraceAble interface {
	ResetDiffValues()
}

type TracerManager

type TracerManager struct {
	OutputFileWrite bool
	// contains filtered or unexported fields
}

func NewTracerManager

func NewTracerManager(iob *IOBalancer, acm *AtmosphereControlManager, cm *ClientManager) *TracerManager

func (*TracerManager) AtmosphereTracer

func (tracer *TracerManager) AtmosphereTracer()

Atmosphere tracer

func (*TracerManager) Close

func (tracer *TracerManager) Close()

func (*TracerManager) CloseOutputFile

func (tracer *TracerManager) CloseOutputFile()

func (*TracerManager) ControllersTracer

func (tracer *TracerManager) ControllersTracer()

func (*TracerManager) CreateOutputFile

func (tracer *TracerManager) CreateOutputFile(flagsData *lib.TracerFlags)

func (*TracerManager) DiskDriveTracer

func (tracer *TracerManager) DiskDriveTracer()

Disk tracer

func (*TracerManager) IOBalancerTracer

func (tracer *TracerManager) IOBalancerTracer()

func (*TracerManager) PrepareJSONBytes

func (tracer *TracerManager) PrepareJSONBytes() []byte

func (*TracerManager) ResetValues

func (tracer *TracerManager) ResetValues()

func (*TracerManager) TracerManagerProcess

func (tracer *TracerManager) TracerManagerProcess(TP *SANProcess, data interface{})

func (*TracerManager) UpdateLogJSON

func (tracer *TracerManager) UpdateLogJSON()

func (*TracerManager) VolumeTracer

func (tracer *TracerManager) VolumeTracer()

func (*TracerManager) WriteToOutputFile

func (tracer *TracerManager) WriteToOutputFile(jsonBytes []byte)

Jump to

Keyboard shortcuts

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