sessionstoretest

package
v0.1.101 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Epoch

func Epoch() time.Time

Epoch anchors the contract fixture an hour back, well inside every store's retention window, so window filters read as minute offsets.

func Fixture

func Fixture(epoch time.Time) []query.SessionRecord

Fixture mirrors the query package's filter fixture: b and c start at the same minute so a startedAt sort needs the id tie-breaker, and d has no labels at all.

func Record

func Record(epoch time.Time, id, profile string, state query.SessionState, startedMin int, events int64, labels map[string]string) query.SessionRecord

Types

type CountingCache

type CountingCache struct {
	cache.Store
	// contains filtered or unexported fields
}

CountingCache counts how often each session's start key is read, so a spec can see which records a request read and how many times.

func NewCountingCache

func NewCountingCache(store cache.Store) *CountingCache

func (*CountingCache) Get

func (c *CountingCache) Get(ctx context.Context, key string) ([]byte, error)

func (*CountingCache) MGet

func (*CountingCache) ReadsOf

func (c *CountingCache) ReadsOf(id string) int

ReadsOf is how often session id's start key was read under any prefix.

func (*CountingCache) Reset

func (c *CountingCache) Reset()

Jump to

Keyboard shortcuts

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