stats

package
Version: v0.0.0-...-a2e7767 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2020 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Action         types.ActionType
	BufferSize     uint64
	CommitInterval uint64
}

type ApplicationStats

type ApplicationStats struct {
	WorkLoad *WorkLoadStats
}

func NewApplicationStats

func NewApplicationStats() *ApplicationStats

type BufferStats

type BufferStats struct {
	TotalAnnouncedSpace uint64 // 总共许诺出的内存块
	TotalAllocatedSpace uint64 // 已经分配出去的内存块
	TotalUsedSpace      uint64 // 已经使用的内存块
	TimeSeriesInMemory  uint64

	// 为2020年11月18日13:07:24实验新增的统计信息
	TotalCommitInterval uint64 // 所有时间序列的总提交时间,便于计算平均提交时间

	TsBufferMap map[[16]byte]*TsBufferStats
}

func NewBufferStats

func NewBufferStats() *BufferStats

type CacheStats

type CacheStats struct {
	CacheHit     uint64
	CacheMiss    uint64
	CacheSize    uint64
	LeafCount    uint64
	NonLeafCount uint64

	RecentCacheHit  uint64
	RecentCacheMiss uint64

	LatestUpdateTime time.Time
}

func NewCacheStats

func NewCacheStats() *CacheStats

type Performance

type Performance struct {
	P float64 // p = \frac{\sum_{j=1}^{q_i} s^{write}_{ij}}{\sum_{j=1}^{q_i} t^{write}_{ij}}
}

type Record

type Record struct {
	Time          time.Time // 进行插入的时间
	Size          int64
	ConsumingTime int64 // 插入耗时
}

type State

type State struct {
	Records       []*Record
	SizeMean      float64
	SizeStd       float64
	DeltaTimeMean float64
	DeltaTimeStd  float64
}

func (*State) Distance

func (s *State) Distance(anotherS *State) float64

func (*State) String

func (s *State) String() string

type StorageStats

type StorageStats struct {
	TotalWriteBlocks uint64
	TotalReadBlocks  uint64
	TotalSpan        time.Duration

	LatestUpdateTime time.Time
}

func NewStorageStats

func NewStorageStats() *StorageStats

type SystemStats

type SystemStats struct {
	TsMap     map[[16]byte]*Ts
	TsList    []*Ts
	TsStatsMu sync.RWMutex

	Buffer      *BufferStats
	BufferMutex sync.RWMutex

	Cache      *CacheStats
	CacheMutex sync.RWMutex

	Storage      *StorageStats
	StorageMutex sync.RWMutex
}

func NewSystemStats

func NewSystemStats() *SystemStats

func (*SystemStats) GetTs

func (system *SystemStats) GetTs(id [16]byte) *Ts

func (*SystemStats) RandomSampleTs

func (system *SystemStats) RandomSampleTs(count int) []*Ts

type Ts

type Ts struct {
	StatsList      *TsStatsList
	ID             [16]byte
	K              uint16
	V              uint32
	CommitInterval uint64
	BufferSize     uint64
	LastCommitTime *time.Time
}

func NewTs

func NewTs(id [16]byte) *Ts

type TsBufferStats

type TsBufferStats struct {
	MaxSize        uint64
	AllocatedSpace uint64
	UsedSpace      uint64
	CommitInterval uint64
	Type           types.BufferType

	LatestCommitted time.Time
}

func NewTsBufferStats

func NewTsBufferStats() *TsBufferStats

type TsStats

type TsStats struct {
	S       *State
	P       *Performance
	A       *Action
	Period  int
	EndTime *time.Time
	Closed  bool
}

func NewTsStats

func NewTsStats() *TsStats

func (*TsStats) AddRecord

func (stats *TsStats) AddRecord(record *Record, id string)

func (*TsStats) CalculateStatisticsAndGetP

func (stats *TsStats) CalculateStatisticsAndGetP() float64

func (*TsStats) CalculateStatisticsAndPerformance

func (stats *TsStats) CalculateStatisticsAndPerformance(id string)

type TsStatsList

type TsStatsList struct {
	Size    int64
	Head    *TsStatsNode
	Tail    *TsStatsNode
	MaxSize int64
}

func NewTsStatsList

func NewTsStatsList(maxSize int64) *TsStatsList

func (*TsStatsList) Append

func (list *TsStatsList) Append(data *TsStats)

func (*TsStatsList) Foreach

func (list *TsStatsList) Foreach(f func(stats *TsStats))

type TsStatsNode

type TsStatsNode struct {
	Data *TsStats
	Prev *TsStatsNode
	Next *TsStatsNode
}

type WorkLoadStats

type WorkLoadStats struct {
	TotalReadBytes  uint64
	TotalWriteBytes uint64

	RecentReadBytes  uint64
	RecentWriteBytes uint64
}

func NewWorkLoadStats

func NewWorkLoadStats() *WorkLoadStats

Jump to

Keyboard shortcuts

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