session

package
v0.0.0-...-a602f81 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2022 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheStats

type CacheStats struct {
	Hits             int
	RefreshHits      int
	Misses           int
	LimitExceeded    int
	CapacityExceeded int
	Errors           int
	Redirects        int
	Total            int
	Others           int
}

func (*CacheStats) Add

func (c *CacheStats) Add(i *CacheStats)

type ResourceTypes

type ResourceTypes map[string]int

func (*ResourceTypes) Add

func (r *ResourceTypes) Add(a *ResourceTypes)

type Session

type Session struct {
	Begin      *time.Time
	End        *time.Time
	IP         *net.IP
	UserAgent  *string
	Crawler    bool
	DataPoints []objects.DataPoint
}

func NewSessionWithDataPoints

func NewSessionWithDataPoints(dps []objects.DataPoint) (*Session, error)

func SplitSessionsByMaxInactiveTime

func SplitSessionsByMaxInactiveTime(s Session, mit time.Duration) (ss []Session)

Split a session to multiple sessions based on a given maximum inactive time

func (*Session) AddDataPoint

func (s *Session) AddDataPoint(dp *objects.DataPoint) error

func (*Session) CacheStats

func (s *Session) CacheStats() *CacheStats

func (*Session) DataByResourceFormat

func (s *Session) DataByResourceFormat(ignoreErrors bool) *ResourceTypes

func (*Session) Validate

func (s *Session) Validate() error

type Sessions

type Sessions []Session

func (*Sessions) AddDataPoint

func (ss *Sessions) AddDataPoint(dp *objects.DataPoint)

func (*Sessions) BounceRate

func (ss *Sessions) BounceRate() float64

func (*Sessions) Bounces

func (ss *Sessions) Bounces() int

func (*Sessions) SplitSessions

func (ss *Sessions) SplitSessions(mit time.Duration)

Jump to

Keyboard shortcuts

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