Documentation ¶
Index ¶
- type Aggregator
- type AverageAggregator
- func (a *AverageAggregator) ProcessValue(v any) error
- func (a *AverageAggregator) ResultFormattedStrings(format string) ([]string, error)
- func (a *AverageAggregator) ResultJSON() ([]byte, error)
- func (a *AverageAggregator) ResultStrings() (map[string]string, error)
- func (a *AverageAggregator) Type() string
- type ChartAggregator
- type SummaryAggregator
- func (s *SummaryAggregator) ProcessValue(v any) error
- func (s *SummaryAggregator) ResultFormattedStrings(format string) ([]string, error)
- func (s *SummaryAggregator) ResultJSON() ([]byte, error)
- func (s *SummaryAggregator) ResultStrings() (map[string]string, error)
- func (s *SummaryAggregator) Type() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Aggregator ¶
type Aggregator interface { ProcessValue(any) 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 []any) (Aggregator, error)
AggregatorByType retrieves an instance of an aggregator given its type like "summarize"
type AverageAggregator ¶
AverageAggregator averages seen values
func NewAverageAggregator ¶
func NewAverageAggregator(args []any) (*AverageAggregator, error)
NewAverageAggregator creates a new AverageAggregator with the specific options supplied
func (*AverageAggregator) ProcessValue ¶
func (a *AverageAggregator) ProcessValue(v any) 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 ¶
ChartAggregator tracks seen values and produce a chart with values bucketed in groups of 50
func NewChartAggregator ¶
func NewChartAggregator(args []any) (*ChartAggregator, error)
NewChartAggregator creates a new ChartAggregator with the specific options
func (*ChartAggregator) ProcessValue ¶
func (s *ChartAggregator) ProcessValue(v any) error
ProcessValue processes and tracks the specific value
func (*ChartAggregator) ResultFormattedStrings ¶
func (s *ChartAggregator) ResultFormattedStrings(format string) ([]string, error)
ResultFormattedStrings returns the chart as a formatted string
func (*ChartAggregator) ResultJSON ¶
func (s *ChartAggregator) ResultJSON() ([]byte, error)
ResultJSON return the chart as a JSON document with the key "chart"
func (*ChartAggregator) ResultStrings ¶
func (s *ChartAggregator) ResultStrings() (map[string]string, error)
ResultStrings returns a map of results in string format in the key "Chart"
func (*ChartAggregator) Type ¶
func (s *ChartAggregator) Type() string
Type is the type of Aggregator
type SummaryAggregator ¶
SummaryAggregator keeps track of seen values and summarize how many times each were seen
func NewSummaryAggregator ¶
func NewSummaryAggregator(args []any) (*SummaryAggregator, error)
NewSummaryAggregator creates a new SummaryAggregator with the specific options supplied
func (*SummaryAggregator) ProcessValue ¶
func (s *SummaryAggregator) ProcessValue(v any) 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