Documentation ¶
Index ¶
- Variables
- func ByteCountSI(b int64) string
- func CopySlice[T any](dst []T, src []T) []T
- func ExtendSlice[T any](xs []T, need int) []T
- func GetMonoTimeNanos() int64
- func PinTo(cpus ...int) error
- func PrependSlice[T any](x T, xs []T) []T
- type FenwickTree
- func (t *FenwickTree) Add(index, delta int)
- func (t *FenwickTree) At(index int) int
- func (t *FenwickTree) Clear(index int) int
- func (t *FenwickTree) Reset()
- func (t *FenwickTree) Size() int
- func (t *FenwickTree) Sum() int
- func (t *FenwickTree) SumFrom(index int) int
- func (t *FenwickTree) SumRange(left, right int) int
- func (t *FenwickTree) SumUntil(index int) (sum int)
- type List
- type OnlineStats
- type Result
- type Stats
- type Tracker
- type TrackerStats
- type TtyHist
- type TtyHistOpts
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrOutOfBounds = errors.New("index out of bounds")
Functions ¶
func ByteCountSI ¶
func ExtendSlice ¶
func GetMonoTimeNanos ¶
func GetMonoTimeNanos() int64
func PrependSlice ¶
func PrependSlice[T any](x T, xs []T) []T
Types ¶
type FenwickTree ¶
type FenwickTree struct {
// contains filtered or unexported fields
}
func NewFenwickTree ¶
func NewFenwickTree(n int) *FenwickTree
func NewFenwickTreeFrom ¶
func NewFenwickTreeFrom(xs []int) *FenwickTree
func (*FenwickTree) Add ¶
func (t *FenwickTree) Add(index, delta int)
func (*FenwickTree) At ¶
func (t *FenwickTree) At(index int) int
func (*FenwickTree) Clear ¶
func (t *FenwickTree) Clear(index int) int
func (*FenwickTree) Reset ¶
func (t *FenwickTree) Reset()
func (*FenwickTree) Size ¶
func (t *FenwickTree) Size() int
func (*FenwickTree) Sum ¶
func (t *FenwickTree) Sum() int
func (*FenwickTree) SumFrom ¶
func (t *FenwickTree) SumFrom(index int) int
func (*FenwickTree) SumRange ¶
func (t *FenwickTree) SumRange(left, right int) int
func (*FenwickTree) SumUntil ¶
func (t *FenwickTree) SumUntil(index int) (sum int)
type List ¶
type List[T comparable] struct { // contains filtered or unexported fields }
List of singly-linked nodes.
func NewList ¶
func NewList[T comparable]() *List[T]
func (*List[T]) RemoveIndex ¶
func (*List[T]) RemoveValue ¶
type OnlineStats ¶
type OnlineStats struct {
// contains filtered or unexported fields
}
OnlineStats gives you min/avg/max/stddev in O(1) time and space.
Note that stddev is less accurate than the one reported by Stats.
func NewOnlineStats ¶
func NewOnlineStats() *OnlineStats
func (*OnlineStats) Add ¶
func (s *OnlineStats) Add(xs ...float64)
func (*OnlineStats) Len ¶
func (s *OnlineStats) Len() int
func (*OnlineStats) Reset ¶
func (s *OnlineStats) Reset()
func (*OnlineStats) Result ¶
func (s *OnlineStats) Result() *Result
type Stats ¶
type Stats struct {
// contains filtered or unexported fields
}
Stats gives you min/avg/max/stddev in O(1) time O(n) space.
type Tracker ¶
type Tracker struct { N int // contains filtered or unexported fields }
func NewTracker ¶
func NewTracker() *Tracker
func NewTrackerWithSamples ¶
func (*Tracker) Record ¶
func (t *Tracker) Record(sample int64) *TrackerStats
type TrackerStats ¶
func (*TrackerStats) Reset ¶
func (s *TrackerStats) Reset()
func (*TrackerStats) String ¶
func (s *TrackerStats) String() string
type TtyHist ¶
type TtyHist struct {
// contains filtered or unexported fields
}
func NewTtyHist ¶
func NewTtyHist(opts TtyHistOpts) *TtyHist
Click to show internal directories.
Click to hide internal directories.