staples

package
v0.0.58 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fingerprint

func Fingerprint(remoteIP, userAgent, domain, host string) (sum uint64)

func NewRecordBuilder

func NewRecordBuilder(mem memory.Allocator, as *arrow.Schema) (*array.RecordBuilder, func(reflect.Value))

func NewTaker

func NewTaker(mem memory.Allocator, as *arrow.Schema) (*array.RecordBuilder, func(arrow.Record, []int, []uint32))

func Schema

func Schema[T any]() *arrow.Schema

Types

type Arrow

type Arrow[T any] struct {
	// contains filtered or unexported fields
}

func NewArrow

func NewArrow[T any](mem memory.Allocator) *Arrow[T]

func (*Arrow[T]) Append

func (a *Arrow[T]) Append(v *T)

func (*Arrow[T]) NewRecord

func (a *Arrow[T]) NewRecord() arrow.Record

func (*Arrow[T]) Release

func (a *Arrow[T]) Release()

type Event

type Event struct {
	Timestamp int64
	ID        int64
	// When a new session is established for the first time we set Bounce to 1, if
	// a user visits another page within the same session for the first time Bounce
	// is set to -1, any subsequent visits within the session sets Bounce to 0.
	//
	// This allows effective calculation of bounce rate by just summing the Bounce
	// column with faster math.Int64.Sum.
	//
	// NOTE: Bounce is calculated per session. We simply want to know if a user
	// stayed and browsed the website.
	Bounce   int64
	Session  int64
	Duration float64

	Browser        string
	BrowserVersion string
	City           string
	Country        string
	Domain         string
	EntryPage      string
	ExitPage       string
	Host           string
	Event          string
	Os             string
	OsVersion      string
	Path           string
	Referrer       string
	ReferrerSource string
	Region         string
	Screen         string
	UtmCampaign    string
	UtmContent     string
	UtmMedium      string
	UtmSource      string
	UtmTerm        string
}

func NewEvent

func NewEvent() *Event

func Parse

func Parse(ctx context.Context, req *v1.Event) *Event

func (*Event) Hit

func (e *Event) Hit()

func (*Event) Release

func (e *Event) Release()

func (*Event) TS

func (e *Event) TS() int64

func (*Event) Update

func (s *Event) Update(e *Event)

type FullIndex

type FullIndex map[string]*index.FullColumn

func (FullIndex) Columns

func (idx FullIndex) Columns(f func(column index.Column) error) error

func (FullIndex) Match

func (idx FullIndex) Match(b *roaring.Bitmap, m []*filters.CompiledFilter)

func (FullIndex) Size

func (idx FullIndex) Size() (n uint64)

type Index

type Index struct {
	Browser        *index.ColumnImpl
	BrowserVersion *index.ColumnImpl
	City           *index.ColumnImpl
	Country        *index.ColumnImpl
	Domain         *index.ColumnImpl
	EntryPage      *index.ColumnImpl
	ExitPage       *index.ColumnImpl
	Host           *index.ColumnImpl
	Event          *index.ColumnImpl
	Os             *index.ColumnImpl
	OsVersion      *index.ColumnImpl
	Path           *index.ColumnImpl
	Referrer       *index.ColumnImpl
	ReferrerSource *index.ColumnImpl
	Region         *index.ColumnImpl
	Screen         *index.ColumnImpl
	UtmCampaign    *index.ColumnImpl
	UtmContent     *index.ColumnImpl
	UtmMedium      *index.ColumnImpl
	UtmSource      *index.ColumnImpl
	UtmTerm        *index.ColumnImpl
	// contains filtered or unexported fields
}

func NewIndex

func NewIndex() *Index

func (*Index) Index

func (idx *Index) Index(r arrow.Record) (index.Full, error)

type Merger

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

func NewMerger

func NewMerger(mem memory.Allocator, as *arrow.Schema) *Merger

func (*Merger) Merge

func (m *Merger) Merge(records ...arrow.Record) arrow.Record

Jump to

Keyboard shortcuts

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