pyroscope

package
v11.1.4-modfix Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: AGPL-3.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const ITEM_OFFSET = 4

ITEM_OFFSET Next bar. Each bar of the profile is represented by 4 number in a flat array.

View Source
const NAME_OFFSET = 3

NAME_OFFSET is index into the names array

View Source
const SELF_OFFSET = 2

SELF_OFFSET is self value of the bar

View Source
const START_OFFSET = 0

START_OFFSET is offset of the bar relative to previous sibling

View Source
const VALUE_OFFSET = 1

VALUE_OFFSET is value or width of the bar

Variables

This section is empty.

Functions

func NewPyroscopeDatasource

func NewPyroscopeDatasource(ctx context.Context, httpClientProvider httpclient.Provider, settings backend.DataSourceInstanceSettings) (instancemgmt.Instance, error)

NewPyroscopeDatasource creates a new datasource instance.

Types

type CustomMeta

type CustomMeta struct {
	ProfileTypeID string
}

type EnumField

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

func NewEnumField

func NewEnumField(name string, labels data.Labels) *EnumField

func (*EnumField) Append

func (e *EnumField) Append(value string)

func (*EnumField) GetField

func (e *EnumField) GetField() *data.Field

type Flamebearer

type Flamebearer struct {
	Names   []string
	Levels  []*Level
	Total   int64
	MaxSelf int64
}

type Function

type Function struct {
	FunctionName string
	FileName     string // optional
	Line         int64  // optional
}

func (Function) String

func (f Function) String() string

type LabelPair

type LabelPair struct {
	Name  string
	Value string
}

type LabelValuesPayload

type LabelValuesPayload struct {
	Query string
	Label string
	Start int64
	End   int64
}

type Level

type Level struct {
	Values []int64
}

type Point

type Point struct {
	Value float64
	// Milliseconds unix timestamp
	Timestamp int64
}

type ProfileResponse

type ProfileResponse struct {
	Flamebearer *Flamebearer
	Units       string
}

type ProfileTree

type ProfileTree struct {
	Start int64
	Value int64
	Self  int64
	Level int
	Name  string
	Nodes []*ProfileTree
}

func (*ProfileTree) String

func (pt *ProfileTree) String() string

type ProfileType

type ProfileType struct {
	ID    string `json:"id"`
	Label string `json:"label"`
}

type ProfilingClient

type ProfilingClient interface {
	ProfileTypes(ctx context.Context, start int64, end int64) ([]*ProfileType, error)
	LabelNames(ctx context.Context, labelSelector string, start int64, end int64) ([]string, error)
	LabelValues(ctx context.Context, label string, labelSelector string, start int64, end int64) ([]string, error)
	GetSeries(ctx context.Context, profileTypeID string, labelSelector string, start int64, end int64, groupBy []string, step float64) (*SeriesResponse, error)
	GetProfile(ctx context.Context, profileTypeID string, labelSelector string, start int64, end int64, maxNodes *int64) (*ProfileResponse, error)
	GetSpanProfile(ctx context.Context, profileTypeID string, labelSelector string, spanSelector []string, start int64, end int64, maxNodes *int64) (*ProfileResponse, error)
}

type PyroscopeClient

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

func NewPyroscopeClient

func NewPyroscopeClient(httpClient *http.Client, url string) *PyroscopeClient

func (*PyroscopeClient) GetProfile

func (c *PyroscopeClient) GetProfile(ctx context.Context, profileTypeID, labelSelector string, start, end int64, maxNodes *int64) (*ProfileResponse, error)

func (*PyroscopeClient) GetSeries

func (c *PyroscopeClient) GetSeries(ctx context.Context, profileTypeID string, labelSelector string, start int64, end int64, groupBy []string, step float64) (*SeriesResponse, error)

func (*PyroscopeClient) GetSpanProfile

func (c *PyroscopeClient) GetSpanProfile(ctx context.Context, profileTypeID, labelSelector string, spanSelector []string, start, end int64, maxNodes *int64) (*ProfileResponse, error)

func (*PyroscopeClient) LabelNames

func (c *PyroscopeClient) LabelNames(ctx context.Context, labelSelector string, start int64, end int64) ([]string, error)

func (*PyroscopeClient) LabelValues

func (c *PyroscopeClient) LabelValues(ctx context.Context, label string, labelSelector string, start int64, end int64) ([]string, error)

func (*PyroscopeClient) ProfileTypes

func (c *PyroscopeClient) ProfileTypes(ctx context.Context, start int64, end int64) ([]*ProfileType, error)

type PyroscopeDatasource

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

PyroscopeDatasource is a datasource for querying application performance profiles.

func (*PyroscopeDatasource) CallResource

func (*PyroscopeDatasource) CheckHealth

CheckHealth handles health checks sent from Grafana to the plugin. The main use case for these health checks is the test button on the datasource configuration page which allows users to verify that a datasource is working as expected.

func (*PyroscopeDatasource) PublishStream

PublishStream is called when a client sends a message to the stream.

func (*PyroscopeDatasource) QueryData

QueryData handles multiple queries and returns multiple responses. req contains the queries []DataQuery (where each query contains RefID as a unique identifier). The QueryDataResponse contains a map of RefID to the response for each query, and each response contains Frames ([]*Frame).

func (*PyroscopeDatasource) RunStream

RunStream is called once for any open channel. Results are shared with everyone subscribed to the same channel.

func (*PyroscopeDatasource) SubscribeStream

SubscribeStream is called when a client wants to connect to a stream. This callback allows sending the first message.

type Series

type Series struct {
	Labels []*LabelPair
	Points []*Point
}

type SeriesResponse

type SeriesResponse struct {
	Series []*Series
	Units  string
	Label  string
}

type Service

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

func ProvideService

func ProvideService(httpClientProvider *httpclient.Provider) *Service

func (*Service) CallResource

func (*Service) CheckHealth

func (*Service) PublishStream

PublishStream is called when a client sends a message to the stream.

func (*Service) QueryData

func (*Service) RunStream

func (s *Service) RunStream(ctx context.Context, req *backend.RunStreamRequest, sender *backend.StreamSender) error

func (*Service) SubscribeStream

Directories

Path Synopsis
kinds

Jump to

Keyboard shortcuts

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