dataframe

package
v0.0.0-...-d18a39a Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Print

func Print(w io.Writer, df Dataframe)

Print formats the dataframe into format usable for debugging and testing purposes (e.g. in examples). Uses tabwriter to produce the table in readable format and shortens fields when possible (such as using only time part of a timestamp) so it fits nicer into the output.

func ToString

func ToString(df Dataframe) string

Types

type AggrOption

type AggrOption struct {
	// Should the aggregation be used?
	Enabled bool
	// Column to store the aggregation at.
	Column string
}

AggrOption defines options for a single aggregation.

type AggrOptionFunc

type AggrOptionFunc func(*AggrsOptions)

type AggrsOptions

type AggrsOptions struct {
	Sum   AggrOption
	Count AggrOption
	Min   AggrOption
	Max   AggrOption
	// contains filtered or unexported fields
}

AggrsOptions ia a collections of aggregations-related options. Determines what aggregations are enabled etc..

type Column

type Column struct {
	Name string
	Type Type
}

type Dataframe

type Dataframe interface {
	Schema() Schema
	RowsIterator() RowsIterator
}

Dataframe exposes ingested data to be used to turn into tabular format.

func FromSeries

func FromSeries(r series.Set, resolution time.Duration, opts ...AggrOptionFunc) (Dataframe, error)

IteratorFromSeries returns iterator that produce dataframe for every series. TODO(bwplotka): Dataframe allows us to do bit more streaming approach. Consider this.

type Record

type Record struct {
	Values map[string]interface{}
}

Record is a single instance of values for specific sample.

type Row

type Row []interface{}

Row stores a single line of a table - the order of columns is defined by the Schema.

type RowsIterator

type RowsIterator interface {
	Next() bool
	At() Row
}

RowsIterator exposes the rows of the dataframe.

type Schema

type Schema []Column

Schema defines columns to be exposed by the dataframe.

type Type

type Type string
const (
	TypeString Type = "string"
	TypeFloat  Type = "float"
	TypeUint   Type = "uint"
	TypeTime   Type = "time"
)

Jump to

Keyboard shortcuts

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