aggregate

package
v0.10.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aggregator

type Aggregator interface {
	ProcessValue(interface{}) error
	ResultStrings() (map[string]string, error)
	ResultFormattedStrings(format string) ([]string, error)
	ResultJSON() ([]byte, error)
	Type() string
}

Aggregator can summarize rpc reply data

func AggregatorByType

func AggregatorByType(t string, args []interface{}) (Aggregator, error)

AggregatorByType retrieves an instance of an aggregator given its type like "summarize"

type AverageAggregator

type AverageAggregator struct {
	sync.Mutex
	// contains filtered or unexported fields
}

AverageAggregator averages seen values

func NewAverageAggregator

func NewAverageAggregator(args []interface{}) (*AverageAggregator, error)

NewAverageAggregator creates a new AverageAggregator with the specific options supplied

func (*AverageAggregator) ProcessValue

func (a *AverageAggregator) ProcessValue(v interface{}) error

ProcessValue processes and tracks the specific value

func (*AverageAggregator) ResultFormattedStrings

func (a *AverageAggregator) ResultFormattedStrings(format string) ([]string, error)

ResultFormattedStrings return the results in a formatted way, if no format is given a calculated value is used

func (*AverageAggregator) ResultJSON

func (a *AverageAggregator) ResultJSON() ([]byte, error)

ResultJSON return the results in JSON format preserving types

func (*AverageAggregator) ResultStrings

func (a *AverageAggregator) ResultStrings() (map[string]string, error)

ResultStrings returns a map of results in string format

func (*AverageAggregator) Type

func (a *AverageAggregator) Type() string

Type is the type of Aggregator

type ChartAggregator added in v0.6.1

type ChartAggregator struct {
	sync.Mutex
	// contains filtered or unexported fields
}

ChartAggregator tracks seen values and produce a sparkline with values bucketed in groups of 50

func NewChartAggregator added in v0.6.1

func NewChartAggregator(args []interface{}) (*ChartAggregator, error)

NewChartAggregator creates a new ChartAggregator with the specific options

func (*ChartAggregator) ProcessValue added in v0.6.1

func (s *ChartAggregator) ProcessValue(v interface{}) error

ProcessValue processes and tracks the specific value

func (*ChartAggregator) ResultFormattedStrings added in v0.6.1

func (s *ChartAggregator) ResultFormattedStrings(format string) ([]string, error)

ResultFormattedStrings returns the chart as a formatted string

func (*ChartAggregator) ResultJSON added in v0.6.1

func (s *ChartAggregator) ResultJSON() ([]byte, error)

ResultJSON return the sparkline as a JSON document with the key "chart"

func (*ChartAggregator) ResultStrings added in v0.6.1

func (s *ChartAggregator) ResultStrings() (map[string]string, error)

ResultStrings returns a map of results in string format in the key "Chart"

func (*ChartAggregator) Type added in v0.6.1

func (s *ChartAggregator) Type() string

Type is the type of Aggregator

type SummaryAggregator

type SummaryAggregator struct {
	sync.Mutex
	// contains filtered or unexported fields
}

SummaryAggregator keeps track of seen values and summarize how many times each were seen

func NewSummaryAggregator

func NewSummaryAggregator(args []interface{}) (*SummaryAggregator, error)

NewSummaryAggregator creates a new SummaryAggregator with the specific options supplied

func (*SummaryAggregator) ProcessValue

func (s *SummaryAggregator) ProcessValue(v interface{}) error

ProcessValue processes and tracks a specified value

func (*SummaryAggregator) ResultFormattedStrings

func (s *SummaryAggregator) ResultFormattedStrings(format string) ([]string, error)

ResultFormattedStrings return the results in a formatted way, if no format is given a calculated value is used

func (*SummaryAggregator) ResultJSON

func (s *SummaryAggregator) ResultJSON() ([]byte, error)

ResultJSON return the results in JSON format preserving types

func (*SummaryAggregator) ResultStrings

func (s *SummaryAggregator) ResultStrings() (map[string]string, error)

ResultStrings returns a map of results in string format

func (*SummaryAggregator) Type

func (s *SummaryAggregator) Type() string

Type is the type of Aggregator

Jump to

Keyboard shortcuts

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