analysis

package
v4.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultLayout = "2006/01/02 15:04:05"

DefaultLayout is the default layout to parse log.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interpreter

type Interpreter interface {
	CompileRegex(operator string) (*regexp.Regexp, error)
	ParseLog(filename string, r *regexp.Regexp) error
}

Interpreter is the interface for all analysis to parse log

type TransferCounter

type TransferCounter struct {
	IsValid   bool
	IsReady   bool
	Redundant uint64
	Necessary uint64
	// contains filtered or unexported fields
}

TransferCounter is to count transfer schedule for judging whether redundant

func GetTransferCounter

func GetTransferCounter() *TransferCounter

GetTransferCounter is to return singleTon for TransferCounter

func (*TransferCounter) AddSource

func (c *TransferCounter) AddSource(regionID, sourceStoreID uint64)

AddSource is be used to add source of edge in graph mat.

func (*TransferCounter) AddTarget

func (c *TransferCounter) AddTarget(regionID, targetStoreID uint64)

AddTarget is be used to add target of edge in graph mat. Firstly add a new peer and then delete the old peer of the scheduling, So in the statistics, also firstly add the target and then add the source.

func (*TransferCounter) CompileRegex

func (c *TransferCounter) CompileRegex(operator string) (*regexp.Regexp, error)

CompileRegex is to provide regexp for transfer counter.

func (*TransferCounter) Init

func (c *TransferCounter) Init(storeNum, regionNum int)

Init for TransferCounter

func (*TransferCounter) ParseLog

func (c *TransferCounter) ParseLog(filename, start, end, layout string, r *regexp.Regexp) error

ParseLog is to parse log for transfer counter.

func (*TransferCounter) PrintResult

func (c *TransferCounter) PrintResult()

PrintResult will print result to log and csv file.

func (*TransferCounter) Result

func (c *TransferCounter) Result()

Result will count redundant schedule and necessary schedule

Jump to

Keyboard shortcuts

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