Documentation ¶
Index ¶
- func Register(scheme string, op Opener) error
- func SyncTask(e *events.Event, db Storer) func(time.Time) error
- type DB
- type DataPoint
- type DataPoints
- func (s DataPoints) Add(t int64, v float64) DataPoints
- func (s DataPoints) AppendJSON(data []byte) []byte
- func (s DataPoints) Avg() float64
- func (s DataPoints) Copy() DataPoints
- func (s DataPoints) Fill(v float64)
- func (s DataPoints) First() *DataPoint
- func (s DataPoints) Get(i int) *DataPoint
- func (s DataPoints) Last() *DataPoint
- func (s DataPoints) MarshalJSON() ([]byte, error)
- func (s DataPoints) Reset() DataPoints
- func (s DataPoints) SeekLeft(ts int64) DataPoints
- func (s DataPoints) SeekRight(ts int64) DataPoints
- func (s DataPoints) Slice(start, end int64) DataPoints
- func (s DataPoints) Sum() (sum float64)
- type Field
- type Fields
- func (fields Fields) AppendBlob(b []byte) ([]byte, error)
- func (fields Fields) AppendGrouped(grouped Fields, empty string, groups []string) Fields
- func (fields Fields) AppendValues(dst []string, empty string, labels ...string) []string
- func (fields Fields) Copy() Fields
- func (fields Fields) Equal(other Fields) bool
- func (fields Fields) FromBlob(b []byte) (Fields, []byte)
- func (fields Fields) Get(label string) (string, bool)
- func (fields Fields) Len() int
- func (fields Fields) Less(i, j int) bool
- func (fields Fields) Map() map[string]string
- func (fields Fields) MarshalJSON() ([]byte, error)
- func (fields Fields) Reset() Fields
- func (fields Fields) Set(label, value string) Fields
- func (fields *Fields) ShiftBlob(b []byte) ([]byte, error)
- func (fields Fields) Sorted() Fields
- func (fields Fields) Swap(i, j int)
- func (fields *Fields) UnmarshalBinary(b []byte) error
- func (fields *Fields) UnmarshalJSON(data []byte) error
- type GroupedResults
- type MatchFields
- func (mf MatchFields) Add(label string, m Matcher) MatchFields
- func (mf MatchFields) Copy() MatchFields
- func (mf MatchFields) Match(fields Fields) bool
- func (mf MatchFields) MatchBytes(label string, b []byte) bool
- func (mf MatchFields) MatchString(label string, s string) bool
- func (mf MatchFields) Merge(other MatchFields) MatchFields
- func (mf MatchFields) Set(label string, m Matcher) MatchFields
- type MatchPrefix
- type MatchString
- type MatchSuffix
- type Matcher
- type Matchers
- type Opener
- type Result
- type ResultGroup
- type Results
- type ScanQuerier
- type ScanQueries
- type ScanQuery
- type Scanner
- type Snapshot
- type Store
- type Storer
- type TimeRange
- type TimeRel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DataPoint ¶
DataPoint is a time/value pair
func (DataPoint) AppendJSON ¶
AppendJSON appends JSON to a buffer
func (DataPoint) MarshalJSON ¶
MarshalJSON implements json.Marshaler interface
func (*DataPoint) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler interface
type DataPoints ¶
type DataPoints []DataPoint
DataPoints is a collection of DataPoints
func BlankData ¶
func BlankData(t *TimeRange, v float64) DataPoints
func (DataPoints) AppendJSON ¶
func (s DataPoints) AppendJSON(data []byte) []byte
AppendJSON appends points as JSON to a buffer
func (DataPoints) Avg ¶
func (s DataPoints) Avg() float64
Avg returns the average value of all points
func (DataPoints) Fill ¶
func (s DataPoints) Fill(v float64)
func (DataPoints) First ¶
func (s DataPoints) First() *DataPoint
First returns a pointer to the first point
func (DataPoints) Get ¶
func (s DataPoints) Get(i int) *DataPoint
Get returns a pointer to the i-th point
func (DataPoints) Last ¶
func (s DataPoints) Last() *DataPoint
Last returns a pointer to the last point
func (DataPoints) MarshalJSON ¶
func (s DataPoints) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshal interface
func (DataPoints) Reset ¶
func (s DataPoints) Reset() DataPoints
func (DataPoints) SeekLeft ¶
func (s DataPoints) SeekLeft(ts int64) DataPoints
func (DataPoints) SeekRight ¶
func (s DataPoints) SeekRight(ts int64) DataPoints
func (DataPoints) Slice ¶
func (s DataPoints) Slice(start, end int64) DataPoints
func (DataPoints) Sum ¶
func (s DataPoints) Sum() (sum float64)
Sum returns the sum of the values of all points
type Fields ¶
type Fields []Field
Fields is a collection of Label/Value pairs
func (Fields) AppendBlob ¶
AppendBlob implements blob.Appender interface
func (Fields) AppendGrouped ¶
func (Fields) AppendValues ¶
AppendValues appends the values for the labels in order
func (Fields) MarshalJSON ¶
MarshalJSON implements json.Marshaler interface
func (*Fields) UnmarshalBinary ¶
func (*Fields) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler interface
type GroupedResults ¶
type GroupedResults []ResultGroup
type MatchFields ¶
func (MatchFields) Add ¶
func (mf MatchFields) Add(label string, m Matcher) MatchFields
func (MatchFields) Copy ¶
func (mf MatchFields) Copy() MatchFields
func (MatchFields) Match ¶
func (mf MatchFields) Match(fields Fields) bool
func (MatchFields) MatchBytes ¶
func (mf MatchFields) MatchBytes(label string, b []byte) bool
func (MatchFields) MatchString ¶
func (mf MatchFields) MatchString(label string, s string) bool
func (MatchFields) Merge ¶
func (mf MatchFields) Merge(other MatchFields) MatchFields
func (MatchFields) Set ¶
func (mf MatchFields) Set(label string, m Matcher) MatchFields
type MatchPrefix ¶
type MatchPrefix string
func (MatchPrefix) Match ¶
func (prefix MatchPrefix) Match(b []byte) bool
func (MatchPrefix) MatchString ¶
func (prefix MatchPrefix) MatchString(s string) bool
type MatchString ¶
type MatchString string
func (MatchString) Match ¶
func (m MatchString) Match(b []byte) bool
func (MatchString) MatchString ¶
func (m MatchString) MatchString(s string) bool
func (MatchString) String ¶
func (m MatchString) String() string
type MatchSuffix ¶
type MatchSuffix string
func (MatchSuffix) Match ¶
func (suffix MatchSuffix) Match(b []byte) bool
func (MatchSuffix) MatchString ¶
func (suffix MatchSuffix) MatchString(s string) bool
type Matchers ¶
type Matchers []Matcher
func (Matchers) MatchString ¶
func (mm Matchers) String() string { return fmt.Sprintf("%s", ([]Matcher)(mm)) }
type Result ¶
type Result struct { TimeRange Event string `json:"event,omitempty"` Fields Fields `json:"fields,omitempty"` Data DataPoints `json:"data,omitempty"` }
Result is a query result
func (*Result) MarshalJSON ¶
type ResultGroup ¶
type Results ¶
type Results []Result
Results is a slice of results
type ScanQuerier ¶
type ScanQueries ¶
type ScanQueries []ScanQuery
func (ScanQueries) Compact ¶
func (queries ScanQueries) Compact() ScanQueries
Compact merges overlapping queries
func (ScanQueries) Merge ¶
func (queries ScanQueries) Merge(other ...ScanQuery) ScanQueries
func (ScanQueries) MergeQuery ¶
func (queries ScanQueries) MergeQuery(q *ScanQuery) ScanQueries
MergeQuery merges a query if it overlaps or appends it to the query list
type ScanQuery ¶
type ScanQuery struct { Event string TimeRange Fields MatchFields }
ScanQuery is a query over a range of time
type Scanner ¶
func NewScanner ¶
func NewScanner(q ScanQuerier) Scanner
NewScanner convers a ScanQuerier to a Scanner
type Snapshot ¶
type Snapshot struct { Time time.Time `json:"time,omitempty"` Labels []string `json:"labels"` Counters []events.Counter `json:"counters"` }
Snapshot is a snaphot of event counters
type TimeRange ¶
type TimeRange struct { Start time.Time `json:"start"` End time.Time `json:"end"` Step time.Duration `json:"step"` }
TimeRange is a range of time with a specific step
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
Package evbadger provides an evdb backend using dgraph.io/badger key-value store
|
Package evbadger provides an evdb backend using dgraph.io/badger key-value store |
Package evredis provides an evdb backend using Redis
|
Package evredis provides an evdb backend using Redis |
internal
|
|