sequencer

package
v0.0.0-...-a467daa Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Datum

type Datum struct {
	Count    int
	Download float64
}

Datum represents a single piece of data. Timeseries graphs are constructed from one element of this struct.

type Meta

type Meta struct {
	ASN, Loc string
}

Meta is the metadata associated with a data sequence. It corresponds to a single line that would be draw on a timeseries graph.

type Sequence

type Sequence struct {
	Key Meta
	Seq map[time.Time]Datum
}

Sequence holds a metadata key and a mapping from date strings to data.

func (*Sequence) SortedSlices

func (s *Sequence) SortedSlices() ([]time.Time, []Datum)

SortedSlices converts a sequence into parallel arrays of dates and data.

type Sequencer

type Sequencer struct {
	// contains filtered or unexported fields
}

Sequencer is designed to work with the bigtable API. It takes data a row at a time and yields Sequence structs out through a specified channel.

func New

func New() (*Sequencer, <-chan *Sequence)

New makes a new Sequencer, and returns it as well as the channel along which it will write sequences.

func (*Sequencer) Done

func (s *Sequencer) Done()

Done is called after ReadRows is completed. It outputs the last sequence (if any) and closes the channel.

func (*Sequencer) ProcessRow

func (s *Sequencer) ProcessRow(r bigtable.Row) bool

ProcessRow processes a single row as required by the bigtable API. It is designed to be passed into ReadRows.

Jump to

Keyboard shortcuts

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