Documentation ¶
Index ¶
- type Indexer
- type Tabulator
- func (d *Tabulator) Add(timestamp time.Time, column string, value float64) bool
- func (d *Tabulator) GetColumns() (columns []string)
- func (d *Tabulator) GetTimestamps() (timestamps []time.Time)
- func (d *Tabulator) GetValues(column string) (values []float64, ok bool)
- func (d *Tabulator) RegisterColumn(column ...string)
- func (d *Tabulator) Size() int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Indexer ¶
type Indexer[T ordered] struct {
// contains filtered or unexported fields
}
Indexer holds a unique set of values, and records the order in which they were added. Currently, it supports string and time.Time data.
func (*Indexer[T]) Add ¶
Add adds a new value to the Indexer. It returns the index of that value and whether the value was actually added.
type Tabulator ¶
type Tabulator struct {
// contains filtered or unexported fields
}
Tabulator tabulates a set of entries in rows by timestamp and columns by label. For performance reasons, data must be added sequentially.
func (*Tabulator) Add ¶
Add adds a value for a specified timestamp and column to the table. If there is already a value for that timestamp and column, the specified value is added to the existing value.
Returns false if the column does not exist. Use RegisterColumn to add it first.
func (*Tabulator) GetColumns ¶
GetColumns returns the (sorted) list of column names.
func (*Tabulator) GetTimestamps ¶
GetTimestamps returns the (sorted) list of timestamps in the table.
func (*Tabulator) GetValues ¶
GetValues returns the value for the specified column for each timestamp in the table. The values are sorted by timestamp.