slot

package
v2.17.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BucketIndex

func BucketIndex(size, this int64) int64

func BucketMinMax

func BucketMinMax(size, index int64) (int64, int64)

Types

type Bucket

type Bucket struct {
	Min int64
	Max int64
}

func BucketsForMinMax

func BucketsForMinMax(size, min, max int64) []Bucket

type SlotData

type SlotData struct {
	SeriesName string
	SlotValue  int64
	SlotNumber int64
}

type SlotDataSeries

type SlotDataSeries struct {
	SeriesName string
	SeriesData map[int64]int64
}

func (*SlotDataSeries) Add

func (series *SlotDataSeries) Add(name string, x, y int64)

func (*SlotDataSeries) AddSlotData

func (series *SlotDataSeries) AddSlotData(slot SlotData)

func (*SlotDataSeries) CreateSlotNumberIfNotExists

func (series *SlotDataSeries) CreateSlotNumberIfNotExists(slotNumber int64)

func (*SlotDataSeries) DataKeysSorted

func (series *SlotDataSeries) DataKeysSorted() []int64

func (*SlotDataSeries) DataValuesSortedByKeys

func (series *SlotDataSeries) DataValuesSortedByKeys() []int64

type SlotDataSeriesSet

type SlotDataSeriesSet struct {
	SeriesSet      map[string]SlotDataSeries
	MinSlotValue   TimeThin
	MaxSlotValue   TimeThin
	Interval       string
	CanonicalSlots []TimeThin
}

func NewSlotDataSeriesSet

func NewSlotDataSeriesSet() SlotDataSeriesSet

func (*SlotDataSeriesSet) AddData

func (set *SlotDataSeriesSet) AddData(data SlotData) error

func (*SlotDataSeriesSet) CreateSeriesIfNotExists

func (set *SlotDataSeriesSet) CreateSeriesIfNotExists(seriesName string)

func (*SlotDataSeriesSet) Inflate

func (set *SlotDataSeriesSet) Inflate()

func (*SlotDataSeriesSet) InflateMinMaxX

func (set *SlotDataSeriesSet) InflateMinMaxX()

type SlotDataSeriesSetSimple

type SlotDataSeriesSetSimple struct {
	SeriesSet map[string]SlotDataSeries
}

SlotDataSeriesSetSimple is useful for C3 Bar Charts

func AggregateSlotDataSeries

func AggregateSlotDataSeries(pointData SlotDataSeriesSetSimple, bucketSize int64) SlotDataSeriesSetSimple

func NewSlotDataSeriesSetSimple

func NewSlotDataSeriesSetSimple() SlotDataSeriesSetSimple

func (SlotDataSeriesSetSimple) Add

func (set SlotDataSeriesSetSimple) Add(dataSeriesName string, x, y int64)

func (SlotDataSeriesSetSimple) KeysSorted

func (set SlotDataSeriesSetSimple) KeysSorted() []string

func (SlotDataSeriesSetSimple) MinMaxX

func (set SlotDataSeriesSetSimple) MinMaxX() (int64, int64)

type SlotDataSeriesString

type SlotDataSeriesString struct {
	SeriesName string
	SeriesData map[string]int64
}

func NewSlotDataSeriesString

func NewSlotDataSeriesString(name string) SlotDataSeriesString

func (*SlotDataSeriesString) Add

func (series *SlotDataSeriesString) Add(desc string, y int64)

type SlotDataSeriesStringSetSimple

type SlotDataSeriesStringSetSimple struct {
	SeriesSet map[string]SlotDataSeriesString
}

func AggregateSlotDataSeriesString

func AggregateSlotDataSeriesString(pointData SlotDataSeriesSetSimple, bucketSize int64) SlotDataSeriesStringSetSimple

func NewSlotDataSeriesStringSetSimple

func NewSlotDataSeriesStringSetSimple() SlotDataSeriesStringSetSimple

func (*SlotDataSeriesStringSetSimple) Add

func (set *SlotDataSeriesStringSetSimple) Add(seriesName, bucketDesc string, y int64)

type TimeThin

type TimeThin struct {
	EpochMs int64
	Time    time.Time
}

Jump to

Keyboard shortcuts

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