Documentation
¶
Index ¶
- func FlattenResults(multi ...db.Results) (flat db.Results)
- func FormatResults(format string, rows ...db.Results) (interface{}, bool)
- func TeeStore(stores ...db.Storer) db.Storer
- func ZipFields(labels []string, values []string) (fields db.Fields)
- type AutoStore
- type EventSummaries
- type EventSummary
- type FieldCache
- func (c *FieldCache) BlobID(blob []byte) (id uint64, ok bool)
- func (c *FieldCache) Fields(id uint64) (fields db.Fields)
- func (c *FieldCache) ID(fields db.Fields) (uint64, bool)
- func (c *FieldCache) Labels() (labels []string)
- func (c *FieldCache) Set(id uint64, fields db.Fields) db.Fields
- func (c *FieldCache) SetBlob(id uint64, blob []byte) db.Fields
- type FieldSummaries
- type FieldSummary
- type MemoryStore
- type MemoryStorer
- type MuxScanner
- type MuxStore
- type StorerFunc
- type SyncStore
- type Table
- type Total
- type Totals
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatResults ¶
FormatResults convers results to requested format
Types ¶
type AutoStore ¶
type AutoStore struct { New func(event string) db.Storer // contains filtered or unexported fields }
AutoStore is a Store that creates a new Storer if it is not Registered
type EventSummaries ¶
type EventSummaries struct { Labels []string Events []string Data []EventSummary }
EventSummaries is a result summary format
func NewEventSummaries ¶
func NewEventSummaries(empty string, results db.Results) *EventSummaries
NewEventSummaries groups results as EventSummaries
func (*EventSummaries) Table ¶
func (s *EventSummaries) Table() Table
Table returns event summaries as a table
type EventSummary ¶
EventSummary groups values with totals
func (*EventSummary) TableRow ¶
func (r *EventSummary) TableRow(events []string) []interface{}
TableRow is a helper to convert event summary to table
type FieldCache ¶
type FieldCache struct {
// contains filtered or unexported fields
}
FieldCache is an in memory cache of field ids
func (*FieldCache) BlobID ¶
func (c *FieldCache) BlobID(blob []byte) (id uint64, ok bool)
BlobID returns the id of raw fields
func (*FieldCache) Fields ¶
func (c *FieldCache) Fields(id uint64) (fields db.Fields)
Fields gets fields by id
func (*FieldCache) ID ¶
func (c *FieldCache) ID(fields db.Fields) (uint64, bool)
ID gets the id of fields
func (*FieldCache) Labels ¶
func (c *FieldCache) Labels() (labels []string)
Labels returns the distinct cached labels
type FieldSummaries ¶
type FieldSummaries []FieldSummary
FieldSummaries is a slice of FieldSummary results
func NewFieldSummaries ¶
func NewFieldSummaries(results db.Results) (s FieldSummaries)
FieldSummaries converts a series of results to a slice of FieldSummary results
type FieldSummary ¶
type FieldSummary struct { Event string `json:"event"` Label string `json:"label"` Values map[string]float64 `json:"values"` }
FieldSummary is a query result presented as a summary of field values
func (*FieldSummary) Add ¶
func (s *FieldSummary) Add(value string, n float64)
Add ads a value to a field summary
type MemoryStore ¶
type MemoryStore map[string]*MemoryStorer
MemoryStore is a Store collecting snapshots in memory
func NewMemoryStore ¶
func NewMemoryStore(events ...string) MemoryStore
NewMemoryStore creates a new MemoryStore
type MemoryStorer ¶
type MemoryStorer struct {
// contains filtered or unexported fields
}
MemoryStorer is an in-memory EventStore for debugging
func (*MemoryStorer) Last ¶
func (m *MemoryStorer) Last() *db.Snapshot
Last retuns the last posted StoreRequest
func (*MemoryStorer) Len ¶
func (m *MemoryStorer) Len() int
Len retuns the number of stored snapshots
type MuxScanner ¶
type MuxScanner map[string]db.ScanQuerier
MuxScanner multiplexes ScanQuerier instances into a Scanner
func (MuxScanner) Set ¶
func (m MuxScanner) Set(s db.ScanQuerier, events ...string) MuxScanner
Set assigns a ScanQuerier instance to some events
type MuxStore ¶
MuxStore maps event names to Storers
type StorerFunc ¶
StorerFunc is a function that implements Storer interface
type SyncStore ¶
type SyncStore struct {
// contains filtered or unexported fields
}
SyncStore provides a mutable Store safe for concurrent use
type Table ¶
type Table struct { Columns []interface{} `json:"cols"` Data [][]interface{} `json:"data"` }
Table holds generic tabular data