metric

package
v0.0.0-...-76698d7 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	INT_MAX = int(^uint(0) >> 1)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HistoryMetric

type HistoryMetric struct {
	Timestamps []time.Time // time from early to late
	Values     []float64
	// contains filtered or unexported fields
}

func NewHistoryMetric

func NewHistoryMetric() HistoryMetric

func (*HistoryMetric) AppendValue

func (m *HistoryMetric) AppendValue(metric TimestampMetric) (int, bool)

func (*HistoryMetric) Capacity

func (m *HistoryMetric) Capacity() int

func (*HistoryMetric) Empty

func (m *HistoryMetric) Empty() bool

func (*HistoryMetric) GetMaxValueInRangeTime

func (m *HistoryMetric) GetMaxValueInRangeTime(start, end time.Time) (float64, error)

Get max value from specific time

func (*HistoryMetric) Len

func (m *HistoryMetric) Len() int

func (*HistoryMetric) SetMaxSize

func (m *HistoryMetric) SetMaxSize(size int) bool

func (*HistoryMetric) String

func (m *HistoryMetric) String() (s string)

func (*HistoryMetric) SubHistoryMetricInRangeTime

func (m *HistoryMetric) SubHistoryMetricInRangeTime(start, end time.Time) (subMetric HistoryMetric)

get sub history metric

type TimestampMetric

type TimestampMetric struct {
	Timestamp time.Time
	Value     float64
}

Jump to

Keyboard shortcuts

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