Documentation
¶
Index ¶
- func Intersect(a, b []int) []int
- func Union(a, b []int) []int
- type HistogramBucket
- type Index
- func (idx *Index) AddRecords(records []parser.Record)
- func (idx *Index) AllIDs() []int
- func (idx *Index) Complement(ids []int) []int
- func (idx *Index) FieldLookup(field, value string) []int
- func (idx *Index) FieldNames() []string
- func (idx *Index) FieldValues(field string) []string
- func (idx *Index) FullTextSearch(text string) []int
- func (idx *Index) Histogram(buckets int, ids []int) []HistogramBucket
- func (idx *Index) NumericGreater(field string, value float64) []int
- func (idx *Index) NumericGreaterEqual(field string, value float64) []int
- func (idx *Index) NumericLess(field string, value float64) []int
- func (idx *Index) NumericLessEqual(field string, value float64) []int
- func (idx *Index) TimeAfter(t time.Time) []int
- func (idx *Index) TimeAfterEqual(t time.Time) []int
- func (idx *Index) TimeBefore(t time.Time) []int
- func (idx *Index) TimeBeforeEqual(t time.Time) []int
- func (idx *Index) TimeRange(start, end time.Time) []int
- type NumericEntry
- type TimeEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HistogramBucket ¶
type HistogramBucket struct {
Start time.Time
End time.Time
Count int
Errors int // count of error/fatal in this bucket
}
HistogramBucket represents one bar in the time histogram.
type Index ¶
type Index struct {
Records []parser.Record
TotalCount int
// contains filtered or unexported fields
}
Index provides fast lookups over a set of parsed log records.
func (*Index) AddRecords ¶ added in v0.2.0
AddRecords appends new records to the index incrementally.
func (*Index) Complement ¶
Complement returns all IDs not in the given sorted slice.
func (*Index) FieldLookup ¶
FieldLookup returns record IDs where field has the given value.
func (*Index) FieldNames ¶ added in v0.6.0
FieldNames returns all indexed field names, sorted alphabetically.
func (*Index) FieldValues ¶ added in v0.6.0
func (*Index) FullTextSearch ¶
FullTextSearch scans all records for a substring match in any field value. Returns matching record IDs.
func (*Index) Histogram ¶
func (idx *Index) Histogram(buckets int, ids []int) []HistogramBucket
Histogram returns bucketed counts for the time range of the given record IDs. If ids is nil, uses all records with timestamps.
func (*Index) NumericGreater ¶
NumericGreater returns record IDs where field > value.
func (*Index) NumericGreaterEqual ¶
NumericGreaterEqual returns record IDs where field >= value.
func (*Index) NumericLess ¶
NumericLess returns record IDs where field < value.
func (*Index) NumericLessEqual ¶
NumericLessEqual returns record IDs where field <= value.
func (*Index) TimeAfterEqual ¶ added in v0.4.0
TimeAfterEqual returns record IDs where timestamp >= t.
func (*Index) TimeBefore ¶ added in v0.4.0
TimeBefore returns record IDs where timestamp < t.
func (*Index) TimeBeforeEqual ¶ added in v0.4.0
TimeBeforeEqual returns record IDs where timestamp <= t.
type NumericEntry ¶
NumericEntry holds a float64 value and the index of the record it belongs to.