Documentation
¶
Index ¶
- func Write(w io.Writer, records []parser.Record, ids []int, format Format) error
- func WriteGroups(w io.Writer, groups []GroupResult, format Format) error
- func WritePatterns(w io.Writer, results []PatternResult, format Format) error
- func WriteWithColumns(w io.Writer, records []parser.Record, ids []int, format Format, ...) error
- type Format
- type GroupResult
- type PatternResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteGroups ¶ added in v0.6.2
func WriteGroups(w io.Writer, groups []GroupResult, format Format) error
WriteGroups writes aggregation results to w in the given format.
func WritePatterns ¶ added in v1.0.0
func WritePatterns(w io.Writer, results []PatternResult, format Format) error
WritePatterns writes pattern clustering results to w in the given format.
Types ¶
type Format ¶
type Format string
Format represents an output format.
func ParseFormat ¶
ParseFormat parses a format string, returning an error for unknown formats.
type GroupResult ¶ added in v0.6.2
GroupResult holds a field value and its count.
func GroupBy ¶ added in v0.6.2
func GroupBy(records []parser.Record, ids []int, field string) []GroupResult
GroupBy counts records per unique value of the given field. Results are sorted descending by count.
func TopN ¶ added in v0.6.2
func TopN(groups []GroupResult, n int) []GroupResult
TopN returns the first n results, or all if n <= 0.
type PatternResult ¶ added in v1.0.0
PatternResult holds a message template and its occurrence count.
Click to show internal directories.
Click to hide internal directories.