storage

package
v0.15.3 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2022 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppNameGetter added in v0.14.0

type AppNameGetter interface {
	GetAppNames(ctx context.Context) []string
}

type Config added in v0.2.5

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

func NewConfig added in v0.2.5

func NewConfig(server *config.Server) *Config

NewConfig returns a new storage config from a server config

func (*Config) WithInMemory added in v0.3.0

func (c *Config) WithInMemory() *Config

WithInMemory makes the storage in-memory.

func (*Config) WithPath added in v0.2.5

func (c *Config) WithPath(path string) *Config

WithPath sets the storage base path

type DeleteInput added in v0.0.33

type DeleteInput struct {
	// Key must match exactly one segment.
	Key *segment.Key
}

type Enqueuer added in v0.14.0

type Enqueuer interface {
	Enqueue(ctx context.Context, input *PutInput)
}

type GetInput added in v0.0.30

type GetInput struct {
	StartTime time.Time
	EndTime   time.Time
	Key       *segment.Key
	Query     *flameql.Query
}

type GetOutput added in v0.0.30

type GetOutput struct {
	Tree       *tree.Tree
	Timeline   *segment.Timeline
	SpyName    string
	SampleRate uint32
	Units      metadata.Units
}

type Getter added in v0.14.0

type Getter interface {
	Get(ctx context.Context, gi *GetInput) (*GetOutput, error)
}

type LabelValuesGetter added in v0.14.0

type LabelValuesGetter interface {
	GetValues(ctx context.Context, key string, cb func(v string) bool)
	GetValuesByQuery(ctx context.Context, label string, query string, cb func(v string) bool) error
}

type LabelsGetter added in v0.14.0

type LabelsGetter interface {
	GetKeys(ctx context.Context, cb func(string) bool)
	GetKeysByQuery(ctx context.Context, query string, cb func(_k string) bool) error
}

type MergeProfilesInput added in v0.12.0

type MergeProfilesInput struct {
	AppName  string
	Profiles []string
}

type MergeProfilesOutput added in v0.12.0

type MergeProfilesOutput struct {
	Tree *tree.Tree
}

type Merger added in v0.14.0

type Merger interface {
	MergeProfiles(ctx context.Context, mi MergeProfilesInput) (o MergeProfilesOutput, err error)
}

type MetricsExporter added in v0.2.1

type MetricsExporter interface {
	// Evaluate evaluates metrics export rules against the input key and creates
	// prometheus counters for new time series, if required. Returned observer can
	// be used to evaluate and observe particular samples.
	//
	// If there are no matching rules, the function returns false.
	Evaluate(*PutInput) (SampleObserver, bool)
}

MetricsExporter exports values of particular stack traces sample from profiling data as a Prometheus metrics.

type PutInput added in v0.0.30

type PutInput struct {
	StartTime       time.Time
	EndTime         time.Time
	Key             *segment.Key
	Val             *tree.Tree
	SpyName         string
	SampleRate      uint32
	Units           metadata.Units
	AggregationType metadata.AggregationType
}

type Putter added in v0.14.0

type Putter interface {
	Put(ctx context.Context, pi *PutInput) error
}

type SampleObserver added in v0.2.1

type SampleObserver interface {
	// Observe adds v to the matched counters if k satisfies node selector.
	// k is a sample stack trace where frames are delimited by semicolon.
	// v is the sample value.
	Observe(k []byte, v int)
}

type Storage

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

func New

func New(c *Config, logger *logrus.Logger, reg prometheus.Registerer, hc *health.Controller) (*Storage, error)

func (*Storage) CacheStats added in v0.0.33

func (s *Storage) CacheStats() map[string]uint64

func (*Storage) Cleanup added in v0.12.0

func (s *Storage) Cleanup(ctx context.Context) error

Cleanup removes malformed data from the storage.

func (*Storage) Close

func (s *Storage) Close() error

func (*Storage) DebugExport added in v0.8.0

func (s *Storage) DebugExport(w http.ResponseWriter, r *http.Request)

func (*Storage) Delete added in v0.0.33

func (s *Storage) Delete(_ context.Context, di *DeleteInput) error

func (*Storage) DeleteApp added in v0.3.1

func (s *Storage) DeleteApp(_ context.Context, appname string) error

DeleteApp fully deletes an app It does so by deleting Segments, Dictionaries, Trees, Dimensions and Labels It's an idempotent call, ie. if the app already does not exist, no error is triggered. TODO cancelation?

func (*Storage) DiskUsage

func (s *Storage) DiskUsage() map[string]bytesize.ByteSize

func (*Storage) Enqueue added in v0.7.0

func (s *Storage) Enqueue(ctx context.Context, input *PutInput)

func (*Storage) Get

func (s *Storage) Get(ctx context.Context, gi *GetInput) (*GetOutput, error)

func (*Storage) GetAppNames added in v0.3.0

func (s *Storage) GetAppNames(ctx context.Context) []string

GetAppNames returns the list of all app's names

func (*Storage) GetKeys

func (s *Storage) GetKeys(_ context.Context, cb func(string) bool)

func (*Storage) GetKeysByQuery added in v0.0.38

func (s *Storage) GetKeysByQuery(_ context.Context, query string, cb func(_k string) bool) error

func (*Storage) GetValues

func (s *Storage) GetValues(_ context.Context, key string, cb func(v string) bool)

func (*Storage) GetValuesByQuery added in v0.0.38

func (s *Storage) GetValuesByQuery(_ context.Context, label string, query string, cb func(v string) bool) error

func (*Storage) InstallID

func (s *Storage) InstallID() string

func (*Storage) JWT added in v0.0.38

func (s *Storage) JWT() (string, error)

func (*Storage) LoadAnalytics added in v0.8.0

func (s *Storage) LoadAnalytics(a interface{}) error

func (*Storage) MergeProfiles added in v0.12.0

func (s *Storage) MergeProfiles(ctx context.Context, mi MergeProfilesInput) (o MergeProfilesOutput, err error)

func (*Storage) Put

func (s *Storage) Put(_ context.Context, pi *PutInput) error

func (*Storage) SaveAnalytics added in v0.8.0

func (s *Storage) SaveAnalytics(a interface{}) error

Directories

Path Synopsis
lfu

Jump to

Keyboard shortcuts

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