timeseries

package
v0.0.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2023 License: AGPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Base           = property.Base
	Event          = property.Event
	Page           = property.Page
	EntryPage      = property.EntryPage
	ExitPage       = property.ExitPage
	Referrer       = property.Referrer
	UtmMedium      = property.UtmMedium
	UtmSource      = property.UtmSource
	UtmCampaign    = property.UtmCampaign
	UtmContent     = property.UtmContent
	UtmTerm        = property.UtmTerm
	UtmDevice      = property.UtmDevice
	UtmBrowser     = property.UtmBrowser
	BrowserVersion = property.BrowserVersion
	Os             = property.Os
	OsVersion      = property.OsVersion
	Country        = property.Country
	Region         = property.Region
	City           = property.City
)
View Source
const (
	Visitors       = property.Visitors
	Views          = property.Views
	Events         = property.Events
	Visits         = property.Visits
	BounceRates    = property.BounceRates
	VisitDurations = property.VisitDurations
)
View Source
const BaseKey = property.BaseKey

Variables

This section is empty.

Functions

func Collect added in v0.0.10

func Collect(ctx context.Context, e *entry.Entry)

func DebugKey added in v0.0.10

func DebugKey(id []byte) string

func DebugPrefix added in v0.0.10

func DebugPrefix(id []byte) string

func DropSite

func DropSite(ctx context.Context, uid, sid uint64)

func GetMike

func GetMike(ctx context.Context) *badger.DB

func GetUnique

func GetUnique(ctx context.Context) *badger.DB

func Open

func Query

func Query(ctx context.Context, uid, sid uint64, r query.Query) (result query.QueryResult)

func Save

func Save(ctx context.Context, b *Buffer)

func SetMap

func SetMap(ctx context.Context, m *Map) context.Context

func Sum

func Sum(ls []uint32) (o uint32)

func Sum16 added in v0.0.11

func Sum16(ls []uint16) (o uint32)

func Time

func Time(id []byte) time.Time

Types

type Buffer

type Buffer struct {
	// contains filtered or unexported fields
}

func NewBuffer

func NewBuffer(uid, sid uint64, ttl time.Duration) *Buffer

func (*Buffer) AddEntry

func (b *Buffer) AddEntry(e ...*entry.Entry)

func (*Buffer) Init

func (b *Buffer) Init(uid, sid uint64, ttl time.Duration) *Buffer

func (*Buffer) Register

func (b *Buffer) Register(ctx context.Context, e *entry.Entry, prevUserId uint64)

func (*Buffer) Release

func (b *Buffer) Release()

func (*Buffer) Reset

func (b *Buffer) Reset() *Buffer

type Key

type Key [keyOffset]byte

func (*Key) Release

func (id *Key) Release()

type Map

type Map struct {
	// contains filtered or unexported fields
}

Maps user ID to *Buffer.

func GetMap

func GetMap(ctx context.Context) *Map

func NewMap

func NewMap(ttl time.Duration) *Map

func (*Map) Close added in v0.0.11

func (m *Map) Close() error

func (*Map) Delete

func (m *Map) Delete(sid uint64)

Removes the buffer associated with sid

func (*Map) Get

func (m *Map) Get(uid, sid uint64) *Buffer

Get returns a *Buffer belonging to a user with uid who owns site with id sid.

func (*Map) Save

func (m *Map) Save(ctx context.Context)

type Metric

type Metric = property.Metric

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
	Timestamp              []int64
	Duration               []time.Duration
	Start                  []int64
	City                   []string
	PageViews              []uint16
	Events                 []uint16
	IsBounce               []bool
	// contains filtered or unexported fields
}

type Plot added in v0.0.11

type Plot struct {
	Metric Metric
	Prop   Property
	Values []uint32
	Sum    uint32
	Count  string
}

type Property

type Property = property.Property

type StatList added in v0.0.8

type StatList []StatValue

func (StatList) Len added in v0.0.8

func (s StatList) Len() int

func (StatList) Less added in v0.0.8

func (s StatList) Less(i, j int) bool

func (StatList) Swap added in v0.0.8

func (s StatList) Swap(i, j int)

type StatValue

type StatValue struct {
	Key   string
	Value uint32
}

func (StatValue) Icon added in v0.0.11

func (s StatValue) Icon() string

type Stats

type Stats struct {
	Period timex.Duration
	Domain string
	Key    string
	Prop   Property
	Result query.QueryResult
}

func (*Stats) QueryPeriod added in v0.0.8

func (s *Stats) QueryPeriod(period timex.Duration) string

func (*Stats) QueryProp added in v0.0.10

func (s *Stats) QueryProp(prop, metric, key string) string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL