metastore

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrLocationNotFound = errors.New("location not found")
	ErrMappingNotFound  = errors.New("mapping not found")
	ErrFunctionNotFound = errors.New("function not found")
)

Functions

This section is empty.

Types

type FunctionKey

type FunctionKey struct {
	StartLine                  int64
	Name, SystemName, FileName string
}

func MakeFunctionKey

func MakeFunctionKey(f *profile.Function) FunctionKey

type FunctionStore

type FunctionStore interface {
	GetFunctionByKey(ctx context.Context, key FunctionKey) (*profile.Function, error)
	CreateFunction(ctx context.Context, f *profile.Function) (uint64, error)
}

type InMemorySQLiteMetaStore

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

func NewInMemorySQLiteProfileMetaStore

func NewInMemorySQLiteProfileMetaStore(
	reg prometheus.Registerer,
	tracer trace.Tracer,
	name ...string,
) (*InMemorySQLiteMetaStore, error)

func (InMemorySQLiteMetaStore) Close

func (s InMemorySQLiteMetaStore) Close() error

func (InMemorySQLiteMetaStore) CreateFunction

func (s InMemorySQLiteMetaStore) CreateFunction(ctx context.Context, fn *profile.Function) (uint64, error)

func (InMemorySQLiteMetaStore) CreateLocation

func (s InMemorySQLiteMetaStore) CreateLocation(ctx context.Context, l *profile.Location) (uint64, error)

func (InMemorySQLiteMetaStore) CreateMapping

func (s InMemorySQLiteMetaStore) CreateMapping(ctx context.Context, m *profile.Mapping) (uint64, error)

func (InMemorySQLiteMetaStore) GetFunctionByKey

func (s InMemorySQLiteMetaStore) GetFunctionByKey(ctx context.Context, k FunctionKey) (*profile.Function, error)

func (InMemorySQLiteMetaStore) GetFunctions

func (s InMemorySQLiteMetaStore) GetFunctions(ctx context.Context) ([]*profile.Function, error)

func (InMemorySQLiteMetaStore) GetLocationByKey

func (s InMemorySQLiteMetaStore) GetLocationByKey(ctx context.Context, k LocationKey) (*profile.Location, error)

func (InMemorySQLiteMetaStore) GetLocations

func (s InMemorySQLiteMetaStore) GetLocations(ctx context.Context) ([]*profile.Location, error)

func (InMemorySQLiteMetaStore) GetLocationsByIDs

func (s InMemorySQLiteMetaStore) GetLocationsByIDs(ctx context.Context, ids ...uint64) (
	map[uint64]*profile.Location,
	error,
)

func (InMemorySQLiteMetaStore) GetMappingByKey

func (s InMemorySQLiteMetaStore) GetMappingByKey(ctx context.Context, k MappingKey) (*profile.Mapping, error)

func (InMemorySQLiteMetaStore) GetMappingsByIDs

func (s InMemorySQLiteMetaStore) GetMappingsByIDs(ctx context.Context, ids ...uint64) (map[uint64]*profile.Mapping, error)

func (InMemorySQLiteMetaStore) GetSymbolizableLocations

func (s InMemorySQLiteMetaStore) GetSymbolizableLocations(ctx context.Context) ([]*profile.Location, error)

func (InMemorySQLiteMetaStore) Ping

func (s InMemorySQLiteMetaStore) Ping() error

func (InMemorySQLiteMetaStore) Symbolize

func (s InMemorySQLiteMetaStore) Symbolize(ctx context.Context, l *profile.Location) error

type Location

type Location struct {
	ID      uint64
	Address uint64
	LocationKey
}

type LocationKey

type LocationKey struct {
	NormalizedAddress, MappingID uint64
	Lines                        string
	IsFolded                     bool
}

func MakeLocationKey

func MakeLocationKey(l *profile.Location) LocationKey

type LocationStore

type LocationStore interface {
	GetLocationByKey(ctx context.Context, k LocationKey) (*profile.Location, error)
	GetLocationsByIDs(ctx context.Context, id ...uint64) (map[uint64]*profile.Location, error)
	CreateLocation(ctx context.Context, l *profile.Location) (uint64, error)
	Symbolize(ctx context.Context, location *profile.Location) error
	GetSymbolizableLocations(ctx context.Context) ([]*profile.Location, error)
}

type MappingKey

type MappingKey struct {
	Size, Offset  uint64
	BuildIDOrFile string
}

func MakeMappingKey

func MakeMappingKey(m *profile.Mapping) MappingKey

type MappingStore

type MappingStore interface {
	GetMappingByKey(ctx context.Context, key MappingKey) (*profile.Mapping, error)
	CreateMapping(ctx context.Context, m *profile.Mapping) (uint64, error)
}

type OnDiskSQLiteMetaStore

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

func NewDiskProfileMetaStore

func NewDiskProfileMetaStore(
	reg prometheus.Registerer,
	tracer trace.Tracer,
	path ...string,
) (*OnDiskSQLiteMetaStore, error)

func (OnDiskSQLiteMetaStore) Close

func (s OnDiskSQLiteMetaStore) Close() error

func (OnDiskSQLiteMetaStore) CreateFunction

func (s OnDiskSQLiteMetaStore) CreateFunction(ctx context.Context, fn *profile.Function) (uint64, error)

func (OnDiskSQLiteMetaStore) CreateLocation

func (s OnDiskSQLiteMetaStore) CreateLocation(ctx context.Context, l *profile.Location) (uint64, error)

func (OnDiskSQLiteMetaStore) CreateMapping

func (s OnDiskSQLiteMetaStore) CreateMapping(ctx context.Context, m *profile.Mapping) (uint64, error)

func (OnDiskSQLiteMetaStore) GetFunctionByKey

func (s OnDiskSQLiteMetaStore) GetFunctionByKey(ctx context.Context, k FunctionKey) (*profile.Function, error)

func (OnDiskSQLiteMetaStore) GetFunctions

func (s OnDiskSQLiteMetaStore) GetFunctions(ctx context.Context) ([]*profile.Function, error)

func (OnDiskSQLiteMetaStore) GetLocationByKey

func (s OnDiskSQLiteMetaStore) GetLocationByKey(ctx context.Context, k LocationKey) (*profile.Location, error)

func (OnDiskSQLiteMetaStore) GetLocations

func (s OnDiskSQLiteMetaStore) GetLocations(ctx context.Context) ([]*profile.Location, error)

func (OnDiskSQLiteMetaStore) GetLocationsByIDs

func (s OnDiskSQLiteMetaStore) GetLocationsByIDs(ctx context.Context, ids ...uint64) (
	map[uint64]*profile.Location,
	error,
)

func (OnDiskSQLiteMetaStore) GetMappingByKey

func (s OnDiskSQLiteMetaStore) GetMappingByKey(ctx context.Context, k MappingKey) (*profile.Mapping, error)

func (OnDiskSQLiteMetaStore) GetMappingsByIDs

func (s OnDiskSQLiteMetaStore) GetMappingsByIDs(ctx context.Context, ids ...uint64) (map[uint64]*profile.Mapping, error)

func (OnDiskSQLiteMetaStore) GetSymbolizableLocations

func (s OnDiskSQLiteMetaStore) GetSymbolizableLocations(ctx context.Context) ([]*profile.Location, error)

func (OnDiskSQLiteMetaStore) Ping

func (s OnDiskSQLiteMetaStore) Ping() error

func (OnDiskSQLiteMetaStore) Symbolize

func (s OnDiskSQLiteMetaStore) Symbolize(ctx context.Context, l *profile.Location) error

type ProfileMetaStore

type ProfileMetaStore interface {
	LocationStore
	FunctionStore
	MappingStore
	Close() error
	Ping() error
}

type RemoteMetaStore

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

func NewRemoteProfileMetaStore

func NewRemoteProfileMetaStore(addr string) (*RemoteMetaStore, error)

func (RemoteMetaStore) Close

func (s RemoteMetaStore) Close() error

func (RemoteMetaStore) CreateFunction

func (s RemoteMetaStore) CreateFunction(ctx context.Context, fn *profile.Function) (uint64, error)

func (RemoteMetaStore) CreateLocation

func (s RemoteMetaStore) CreateLocation(ctx context.Context, l *profile.Location) (uint64, error)

func (RemoteMetaStore) CreateMapping

func (s RemoteMetaStore) CreateMapping(ctx context.Context, m *profile.Mapping) (uint64, error)

func (RemoteMetaStore) GetFunctionByKey

func (s RemoteMetaStore) GetFunctionByKey(ctx context.Context, k FunctionKey) (*profile.Function, error)

func (RemoteMetaStore) GetFunctions

func (s RemoteMetaStore) GetFunctions(ctx context.Context) ([]*profile.Function, error)

func (RemoteMetaStore) GetLocationByKey

func (s RemoteMetaStore) GetLocationByKey(ctx context.Context, k LocationKey) (*profile.Location, error)

func (RemoteMetaStore) GetLocations

func (s RemoteMetaStore) GetLocations(ctx context.Context) ([]*profile.Location, error)

func (RemoteMetaStore) GetLocationsByIDs

func (s RemoteMetaStore) GetLocationsByIDs(ctx context.Context, ids ...uint64) (
	map[uint64]*profile.Location,
	error,
)

func (RemoteMetaStore) GetMappingByKey

func (s RemoteMetaStore) GetMappingByKey(ctx context.Context, k MappingKey) (*profile.Mapping, error)

func (RemoteMetaStore) GetMappingsByIDs

func (s RemoteMetaStore) GetMappingsByIDs(ctx context.Context, ids ...uint64) (map[uint64]*profile.Mapping, error)

func (RemoteMetaStore) GetSymbolizableLocations

func (s RemoteMetaStore) GetSymbolizableLocations(ctx context.Context) ([]*profile.Location, error)

func (RemoteMetaStore) Ping

func (s RemoteMetaStore) Ping() error

func (RemoteMetaStore) Symbolize

func (s RemoteMetaStore) Symbolize(ctx context.Context, l *profile.Location) error

Jump to

Keyboard shortcuts

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