Documentation ¶
Index ¶
- Constants
- func DropSite(ctx context.Context, uid, sid uint64)
- func GetMike(ctx context.Context) *badger.DB
- func GetUnique(ctx context.Context) *badger.DB
- func Open(ctx context.Context, o *config.Options) (context.Context, io.Closer, error)
- func Save(ctx context.Context, b *Buffer)
- func SetMap(ctx context.Context, m *Map) context.Context
- func Time(id []byte) uint64
- type Aggregate
- type AggregateMetricsStatValue
- type AggregateValue
- type BaseQuery
- type Buffer
- func (b *Buffer) AddEntry(e ...*entry.Entry)
- func (b *Buffer) Build(ctx context.Context, f func(p Property, key string, sum *Sum) error) error
- func (b *Buffer) Init(uid, sid uint64, ttl time.Duration) *Buffer
- func (b *Buffer) Register(ctx context.Context, e *entry.Entry, prevUserId uint64)
- func (b *Buffer) Release()
- func (b *Buffer) Reset() *Buffer
- func (b *Buffer) SID() uint64
- func (b *Buffer) UID() uint64
- type Filter
- type FilterAnd
- type FilterExpr
- type FilterList
- type FilterOr
- type FloatValue
- type Key
- type Map
- type Metric
- type MetricResult
- type MultiEntry
- type OutValue
- type PropertiesResult
- type Property
- type QueryRequest
- type QueryResult
- type RootOptions
- type StatList
- type StatValue
- type Stats
- type Sum
- type Value
Constants ¶
View Source
const BaseKey = "__root__"
View Source
const SessionTime = time.Minute * 10
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Aggregate ¶
type Aggregate map[string]AggregateMetricsStatValue
type AggregateMetricsStatValue ¶ added in v0.0.8
type AggregateValue ¶ added in v0.0.8
type AggregateValue map[string]FloatValue
AggregateValue maps keys to value for a specific metric
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
type Filter ¶
type Filter struct { Property Property `json:"prop"` Omit []Metric `json:"omitMetrics,omitempty"` Expr FilterExpr `json:"expr"` }
type FilterAnd ¶
type FilterAnd []*FilterExpr
type FilterExpr ¶
type FilterExpr struct { Property Property `json:"prop"` And FilterAnd `json:"and,omitempty"` Or FilterAnd `json:"or,omitempty"` Text string `json:"text,omitempty"` IsRe bool `json:"isRe,omitempty"` IsGlob bool `json:"isGlob,omitempty"` Re *regexp.Regexp `json:"-"` }
func (*FilterExpr) Compile ¶
func (m *FilterExpr) Compile() error
func (*FilterExpr) ExactMatch ¶
func (m *FilterExpr) ExactMatch() bool
func (*FilterExpr) Match ¶
func (m *FilterExpr) Match(txt []byte) bool
func (*FilterExpr) Validate ¶
func (m *FilterExpr) Validate() error
type FilterList ¶
type FilterList []*Filter
func (FilterList) Validate ¶
func (f FilterList) Validate() error
type FilterOr ¶
type FilterOr []*FilterExpr
type FloatValue ¶
type FloatValue float64
func (FloatValue) String ¶
func (v FloatValue) String() string
type Map ¶
type Map struct {
// contains filtered or unexported fields
}
Maps user ID to *Buffer.
type MetricResult ¶
type MultiEntry ¶
type MultiEntry struct { UtmMedium []string Referrer []string Domain []string ExitPage []string EntryPage []string Hostname []string Pathname []string UtmSource []string ReferrerSource []string CountryCode []string Region []string Subdivision2Code []string TransferredFrom []string UtmCampaign []string OperatingSystem []string Browser []string UtmTerm []string Name []string ScreenSize []string BrowserVersion []string OperatingSystemVersion []string UtmContent []string UserId []uint64 SessionId []uint64 Timestamp []int64 Duration []time.Duration Start []int64 City []string PageViews []int32 Events []int32 Sign []int32 IsBounce []bool // contains filtered or unexported fields }
type PropertiesResult ¶
type PropertiesResult map[string]MetricResult
type Property ¶
type Property uint8
const ( Base Property = 0 Event Property = 1 Page Property = 2 EntryPage Property = 3 ExitPage Property = 4 Referrer Property = 5 UtmMedium Property = 6 UtmSource Property = 7 UtmCampaign Property = 8 UtmContent Property = 9 UtmTerm Property = 10 UtmDevice Property = 11 UtmBrowser Property = 12 BrowserVersion Property = 13 Os Property = 14 OsVersion Property = 15 Country Property = 16 Region Property = 17 City Property = 18 )
func ParseProperty ¶ added in v0.0.8
func (Property) MarshalJSON ¶
func (*Property) UnmarshalJSON ¶
type QueryRequest ¶
type QueryResult ¶
type QueryResult struct { ELapsed time.Duration `json:"elapsed"` Start time.Time `json:"start"` End time.Time `json:"end"` Timestamps []int64 `json:"timestamps"` Result PropertiesResult `json:"result"` }
func Query ¶
func Query(ctx context.Context, r QueryRequest) (result QueryResult)
type RootOptions ¶
type RootOptions struct { Metric Metric `json:"metric,omitempty"` Prop Property `json:"prop,omitempty"` Key string `json:"key,omitempty"` Start time.Time `json:"start,omitempty"` Window time.Duration `json:"window,omitempty"` Offset time.Duration `json:"offset,omitempty"` // When set to true and Prop is Base, other props will not be queried. This is // useful to query only base aggregates . Like the one used on sites // index. NoProps bool `json:"noProps,omitempty"` }
type StatValue ¶
type StatValue struct { Key string Value FloatValue }
type Stats ¶
Click to show internal directories.
Click to hide internal directories.