session

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCloudTokenRequired = errors.New("Please provide an authentication token. You can find it here: https://pyroscope.io/cloud")
	ErrUpload             = errors.New("Failed to upload a profile")
	ErrUpgradeServer      = errors.New("Newer version of pyroscope server required (>= v0.3.1). Visit https://pyroscope.io/docs/golang/ for more information")
)

Functions

This section is empty.

Types

type Double

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

implements upstream.Payload

func (Double) Bytes

func (d Double) Bytes() []byte

TODO: I don't think append is very efficient

type Payload

type Payload interface {
	Bytes() []byte
}

type Remote

type Remote struct {
	Logger types.Logger
	// contains filtered or unexported fields
}

func NewRemote

func NewRemote(cfg RemoteConfig, logger types.Logger) (*Remote, error)

func (*Remote) Start

func (r *Remote) Start()

func (*Remote) Stop

func (r *Remote) Stop()

func (*Remote) Upload

func (r *Remote) Upload(job *UploadJob)

type RemoteConfig

type RemoteConfig struct {
	AuthToken              string
	UpstreamThreads        int
	UpstreamAddress        string
	UpstreamRequestTimeout time.Duration

	ManualStart bool
}

type Session

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

func NewSession

func NewSession(c SessionConfig) (*Session, error)

func (*Session) Start

func (ps *Session) Start() error

func (*Session) Stop

func (ps *Session) Stop()

type SessionConfig

type SessionConfig struct {
	Upstream
	types.Logger
	AppName        string
	Tags           map[string]string
	ProfilingTypes []types.ProfileType
	DisableGCRuns  bool
	SampleRate     uint32
	UploadRate     time.Duration
}

type SetAppNamer

type SetAppNamer interface {
	SetAppName(string)
}

TODO: horrible API, change this

type Single

type Single []byte

implements upstream.Payload

func (Single) Bytes

func (s Single) Bytes() []byte

func (Single) BytesWithLength

func (s Single) BytesWithLength() []byte

TODO: I don't think append is very efficient

type UploadFormat

type UploadFormat string
const (
	Pprof UploadFormat = "pprof"
	Trie               = "trie"
)

type UploadJob

type UploadJob struct {
	Name            string
	StartTime       time.Time
	EndTime         time.Time
	SpyName         string
	SampleRate      uint32
	Units           string
	AggregationType string
	Format          UploadFormat
	Profile         []byte
	PrevProfile     []byte
}

type Upstream

type Upstream interface {
	Stop()
	Upload(u *UploadJob)
}

Jump to

Keyboard shortcuts

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