Documentation ¶
Index ¶
- Constants
- type Interpreter
- type TransferCounter
- func (c *TransferCounter) AddSource(regionID, sourceStoreID uint64)
- func (c *TransferCounter) AddTarget(regionID, targetStoreID uint64)
- func (*TransferCounter) CompileRegex(operator string) (*regexp.Regexp, error)
- func (c *TransferCounter) Init(storeNum, regionNum int)
- func (*TransferCounter) ParseLog(filename, start, end, layout string, r *regexp.Regexp) error
- func (c *TransferCounter) PrintResult()
- func (c *TransferCounter) Result()
Constants ¶
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 (*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 (*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