Documentation ¶
Index ¶
- Variables
- func GetLocationsByIDs(ctx context.Context, s ProfileMetaStore, ids ...[]byte) (map[string]*Location, error)
- func MakeFunctionKey(f *pb.Function) []byte
- func MakeLocationKey(l *Location) []byte
- func MakeMappingKey(m *pb.Mapping) []byte
- func UnsymbolizableMapping(m *pb.Mapping) bool
- type BadgerLogger
- type BadgerMetastore
- func (m *BadgerMetastore) Close() error
- func (m *BadgerMetastore) CreateFunction(ctx context.Context, f *pb.Function) ([]byte, error)
- func (m *BadgerMetastore) CreateLocation(ctx context.Context, l *Location) ([]byte, error)
- func (m *BadgerMetastore) CreateLocationLines(ctx context.Context, locID []byte, lines []LocationLine) error
- func (m *BadgerMetastore) CreateMapping(ctx context.Context, mapping *pb.Mapping) ([]byte, error)
- func (m *BadgerMetastore) CreateStacktrace(ctx context.Context, key []byte, sample *pb.Sample) (uuid.UUID, error)
- func (m *BadgerMetastore) GetFunctionByKey(ctx context.Context, key *pb.Function) (*pb.Function, error)
- func (m *BadgerMetastore) GetFunctions(ctx context.Context) ([]*pb.Function, error)
- func (m *BadgerMetastore) GetFunctionsByIDs(ctx context.Context, ids ...[]byte) (map[string]*pb.Function, error)
- func (m *BadgerMetastore) GetLinesByLocationIDs(ctx context.Context, ids ...[]byte) (map[string][]*pb.Line, [][]byte, error)
- func (m *BadgerMetastore) GetLocationByKey(ctx context.Context, key *Location) (*pb.Location, error)
- func (m *BadgerMetastore) GetLocations(ctx context.Context) ([]*pb.Location, [][]byte, error)
- func (m *BadgerMetastore) GetLocationsByIDs(ctx context.Context, ids ...[]byte) (map[string]*pb.Location, [][]byte, error)
- func (m *BadgerMetastore) GetMappingByKey(ctx context.Context, key *pb.Mapping) (*pb.Mapping, error)
- func (m *BadgerMetastore) GetMappingsByIDs(ctx context.Context, ids ...[]byte) (map[string]*pb.Mapping, error)
- func (m *BadgerMetastore) GetStacktraceByIDs(ctx context.Context, ids ...[]byte) (map[string]*pb.Sample, error)
- func (m *BadgerMetastore) GetStacktraceByKey(ctx context.Context, key []byte) (uuid.UUID, error)
- func (m *BadgerMetastore) GetSymbolizableLocations(ctx context.Context) ([]*pb.Location, [][]byte, error)
- func (m *BadgerMetastore) Ping() error
- func (m *BadgerMetastore) Symbolize(ctx context.Context, l *Location) error
- type FunctionKey
- type FunctionStore
- type LinearUUIDGenerator
- type Location
- type LocationKey
- type LocationLine
- type LocationLineStore
- type LocationStore
- type MappingKey
- type MappingStore
- type ProfileMetaStore
- type RandomUUIDGenerator
- type RemoteMetaStore
- func (s RemoteMetaStore) Close() error
- func (s RemoteMetaStore) CreateFunction(ctx context.Context, fn *pb.Function) ([]byte, error)
- func (s RemoteMetaStore) CreateLocation(ctx context.Context, l *Location) ([]byte, error)
- func (s RemoteMetaStore) CreateLocationLines(ctx context.Context, locID []byte, lines []LocationLine) error
- func (s RemoteMetaStore) CreateMapping(ctx context.Context, m *pb.Mapping) ([]byte, error)
- func (r RemoteMetaStore) CreateStacktrace(ctx context.Context, key []byte, sample *pb.Sample) (uuid.UUID, error)
- func (s RemoteMetaStore) GetFunctionByKey(ctx context.Context, fkey *pb.Function) (*pb.Function, error)
- func (s RemoteMetaStore) GetFunctions(ctx context.Context) ([]*pb.Function, error)
- func (s RemoteMetaStore) GetFunctionsByIDs(ctx context.Context, ids ...[]byte) (map[string]*pb.Function, error)
- func (s RemoteMetaStore) GetLinesByLocationIDs(ctx context.Context, ids ...[]byte) (map[string][]*pb.Line, [][]byte, error)
- func (s RemoteMetaStore) GetLocationByKey(ctx context.Context, lkey *Location) (*pb.Location, error)
- func (s RemoteMetaStore) GetLocations(ctx context.Context) ([]*pb.Location, [][]byte, error)
- func (s RemoteMetaStore) GetLocationsByIDs(ctx context.Context, ids ...[]byte) (map[string]*pb.Location, [][]byte, error)
- func (s RemoteMetaStore) GetMappingByKey(ctx context.Context, mkey *pb.Mapping) (*pb.Mapping, error)
- func (s RemoteMetaStore) GetMappingsByIDs(ctx context.Context, ids ...[]byte) (map[string]*pb.Mapping, error)
- func (r RemoteMetaStore) GetStacktraceByIDs(ctx context.Context, ids ...[]byte) (map[string]*pb.Sample, error)
- func (r RemoteMetaStore) GetStacktraceByKey(ctx context.Context, key []byte) (uuid.UUID, error)
- func (s RemoteMetaStore) GetSymbolizableLocations(ctx context.Context) ([]*pb.Location, [][]byte, error)
- func (s RemoteMetaStore) Ping() error
- func (s RemoteMetaStore) Symbolize(ctx context.Context, l *Location) error
- type StacktraceStore
- type UUIDGenerator
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func GetLocationsByIDs ¶
func MakeFunctionKey ¶
func MakeLocationKey ¶
func MakeMappingKey ¶
func UnsymbolizableMapping ¶
UnsymbolizableMapping returns true if a mapping points to a binary for which locations can't be symbolized in principle, at least now. Examples are "[vdso]", [vsyscall]" and some others, see the code.
Types ¶
type BadgerLogger ¶
type BadgerLogger struct {
// contains filtered or unexported fields
}
func (*BadgerLogger) Debugf ¶
func (l *BadgerLogger) Debugf(f string, v ...interface{})
func (*BadgerLogger) Errorf ¶
func (l *BadgerLogger) Errorf(f string, v ...interface{})
func (*BadgerLogger) Infof ¶
func (l *BadgerLogger) Infof(f string, v ...interface{})
func (*BadgerLogger) Warningf ¶
func (l *BadgerLogger) Warningf(f string, v ...interface{})
type BadgerMetastore ¶
type BadgerMetastore struct {
// contains filtered or unexported fields
}
BadgerMetastore is an implementation of the metastore using the badger KV store.
func NewBadgerMetastore ¶
func NewBadgerMetastore( logger log.Logger, reg prometheus.Registerer, tracer trace.Tracer, uuidGenerator UUIDGenerator, ) *BadgerMetastore
NewBadgerMetastore returns a new BadgerMetastore with using in-memory badger instance.
func (*BadgerMetastore) Close ¶
func (m *BadgerMetastore) Close() error
Close closes the badger store.
func (*BadgerMetastore) CreateFunction ¶
CreateFunction creates a new function in the database.
func (*BadgerMetastore) CreateLocation ¶
func (*BadgerMetastore) CreateLocationLines ¶
func (m *BadgerMetastore) CreateLocationLines(ctx context.Context, locID []byte, lines []LocationLine) error
CreateLocationLines writes a set of lines related to a location to the database.
func (*BadgerMetastore) CreateMapping ¶
CreateMapping creates a new mapping in the database.
func (*BadgerMetastore) CreateStacktrace ¶
func (*BadgerMetastore) GetFunctionByKey ¶
func (m *BadgerMetastore) GetFunctionByKey(ctx context.Context, key *pb.Function) (*pb.Function, error)
GetFunctionByKey returns the function for the given key.
func (*BadgerMetastore) GetFunctions ¶
GetFunctions returns all functions in the database.
func (*BadgerMetastore) GetFunctionsByIDs ¶
func (m *BadgerMetastore) GetFunctionsByIDs(ctx context.Context, ids ...[]byte) (map[string]*pb.Function, error)
GetFunctionByID returns the function for the given ID.
func (*BadgerMetastore) GetLinesByLocationIDs ¶
func (m *BadgerMetastore) GetLinesByLocationIDs(ctx context.Context, ids ...[]byte) ( map[string][]*pb.Line, [][]byte, error, )
GetLinesByLocationIDs returns the lines for the given location IDs.
func (*BadgerMetastore) GetLocationByKey ¶
func (*BadgerMetastore) GetLocations ¶
func (*BadgerMetastore) GetLocationsByIDs ¶
func (*BadgerMetastore) GetMappingByKey ¶
func (m *BadgerMetastore) GetMappingByKey(ctx context.Context, key *pb.Mapping) (*pb.Mapping, error)
GetMappingByKey returns the mapping for the given key.
func (*BadgerMetastore) GetMappingsByIDs ¶
func (m *BadgerMetastore) GetMappingsByIDs(ctx context.Context, ids ...[]byte) (map[string]*pb.Mapping, error)
GetMappingsByIDs returns the mappings for the given IDs.
func (*BadgerMetastore) GetStacktraceByIDs ¶
func (*BadgerMetastore) GetStacktraceByKey ¶
func (*BadgerMetastore) GetSymbolizableLocations ¶
func (*BadgerMetastore) Ping ¶
func (m *BadgerMetastore) Ping() error
Ping returns an error if the metastore is not available.
type FunctionKey ¶
func MakeSQLFunctionKey ¶
func MakeSQLFunctionKey(f *pb.Function) FunctionKey
type FunctionStore ¶
type FunctionStore interface { GetFunctionByKey(ctx context.Context, key *pb.Function) (*pb.Function, error) CreateFunction(ctx context.Context, f *pb.Function) ([]byte, error) GetFunctionsByIDs(ctx context.Context, ids ...[]byte) (map[string]*pb.Function, error) GetFunctions(ctx context.Context) ([]*pb.Function, error) }
type LinearUUIDGenerator ¶
type LinearUUIDGenerator struct {
// contains filtered or unexported fields
}
Some tests need UUID generation to be predictable, so this generator just returns monotonically increasing UUIDs as if the UUID was a 16 byte integer. WARNING: THIS IS ONLY MEANT FOR TESTING.
func (*LinearUUIDGenerator) New ¶
func (g *LinearUUIDGenerator) New() uuid.UUID
New returns the next UUID according to the current count.
type Location ¶
type Location struct { ID uuid.UUID Address uint64 Mapping *pb.Mapping Lines []LocationLine IsFolded bool }
func GetLocationByKey ¶
func GetLocations ¶
func GetLocations(ctx context.Context, s ProfileMetaStore) ([]*Location, error)
Only used in tests so not as important to be efficient.
func GetSymbolizableLocations ¶
func GetSymbolizableLocations(ctx context.Context, s ProfileMetaStore) ( []*Location, error, )
type LocationKey ¶
func MakeSQLLocationKey ¶
func MakeSQLLocationKey(l *Location) LocationKey
type LocationLine ¶
type LocationLineStore ¶
type LocationStore ¶
type LocationStore interface { GetLocations(ctx context.Context) ([]*pb.Location, [][]byte, error) GetLocationByKey(ctx context.Context, key *Location) (*pb.Location, error) GetLocationsByIDs(ctx context.Context, id ...[]byte) (map[string]*pb.Location, [][]byte, error) CreateLocation(ctx context.Context, l *Location) ([]byte, error) Symbolize(ctx context.Context, location *Location) error GetSymbolizableLocations(ctx context.Context) ([]*pb.Location, [][]byte, error) }
type MappingKey ¶
func MakeSQLMappingKey ¶
func MakeSQLMappingKey(m *pb.Mapping) MappingKey
type MappingStore ¶
type ProfileMetaStore ¶
type ProfileMetaStore interface { StacktraceStore LocationStore LocationLineStore FunctionStore MappingStore Close() error Ping() error }
type RandomUUIDGenerator ¶
type RandomUUIDGenerator struct{}
RandomUUIDGenerator returns a new random UUID.
func (*RandomUUIDGenerator) New ¶
func (g *RandomUUIDGenerator) New() uuid.UUID
New returns a new UUID.
type RemoteMetaStore ¶
type RemoteMetaStore struct {
// contains filtered or unexported fields
}
func NewRemoteMetaStore ¶ added in v0.9.0
func NewRemoteMetaStore(reg prometheus.Registerer, db *sql.DB) (*RemoteMetaStore, error)
NewRemoteMetaStore creates a sql metastore with given remote database connection.
func (RemoteMetaStore) CreateFunction ¶
func (RemoteMetaStore) CreateLocation ¶
func (RemoteMetaStore) CreateLocationLines ¶
func (s RemoteMetaStore) CreateLocationLines(ctx context.Context, locID []byte, lines []LocationLine) error
func (RemoteMetaStore) CreateMapping ¶
func (RemoteMetaStore) CreateStacktrace ¶
func (RemoteMetaStore) GetFunctionByKey ¶
func (RemoteMetaStore) GetFunctions ¶
func (RemoteMetaStore) GetFunctionsByIDs ¶
func (RemoteMetaStore) GetLinesByLocationIDs ¶
func (RemoteMetaStore) GetLocationByKey ¶
func (RemoteMetaStore) GetLocations ¶
func (RemoteMetaStore) GetLocationsByIDs ¶
func (RemoteMetaStore) GetMappingByKey ¶
func (RemoteMetaStore) GetMappingsByIDs ¶
func (RemoteMetaStore) GetStacktraceByIDs ¶
func (RemoteMetaStore) GetStacktraceByKey ¶
func (RemoteMetaStore) GetSymbolizableLocations ¶
type StacktraceStore ¶
type UUIDGenerator ¶
UUIDGenerator returns new UUIDs.
func NewLinearUUIDGenerator ¶
func NewLinearUUIDGenerator() UUIDGenerator
NewLinearUUIDGenerator returns a new LinearUUIDGenerator.
func NewRandomUUIDGenerator ¶
func NewRandomUUIDGenerator() UUIDGenerator
NewRandomUUIDGenerator returns a new random UUID generator.