pproflite

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2023 License: Apache-2.0, BSD-3-Clause, Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package pproflite implements zero-allocation pprof encoding and decoding.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Comment

type Comment struct{ Value int64 }

Comment is field 13

type Decoder

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

Decoder ...

func NewDecoder

func NewDecoder(input []byte) *Decoder

NewDecoder ...

func (*Decoder) FieldEach

func (d *Decoder) FieldEach(fn func(Field) error, filter ...FieldDecoder) error

FieldEach invokes fn for every decoded Field. If filters are provided, only fields matching the filters will be decoded.

func (*Decoder) Reset

func (d *Decoder) Reset(input []byte)

Reset ...

type DefaultSampleType

type DefaultSampleType struct{ Value int64 }

DefaultSampleType is field 14

type DropFrames

type DropFrames struct{ Value int64 }

DropFrames is field 7

type DurationNanos

type DurationNanos struct{ Value int64 }

DurationNanos is field 10

type Encoder

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

Encoder ...

func NewEncoder

func NewEncoder(w io.Writer) *Encoder

NewEncoder ...

func (*Encoder) Encode

func (e *Encoder) Encode(f Field) error

Encode ...

func (*Encoder) Reset

func (e *Encoder) Reset(w io.Writer)

Reset ...

type Field

type Field interface {
	// contains filtered or unexported methods
}

Field holds the value of a top-level profile.proto Profile.* field.

type FieldDecoder

type FieldDecoder int

FieldDecoder ...

const (
	SampleTypeDecoder FieldDecoder = iota
	SampleDecoder
	MappingDecoder
	LocationDecoder
	LocationFastDecoder
	FunctionDecoder
	StringTableDecoder
	DropFramesDecoder
	KeepFramesDecoder
	TimeNanosDecoder
	DurationNanosDecoder
	PeriodTypeDecoder
	PeriodDecoder
	CommentDecoder
	DefaultSampleTypeDecoder
)

Important: For fields with multiple decoders, list the default decoder first here (e.g. Location before LocationID).

type Function

type Function struct {
	ID         uint64
	Name       int64
	SystemName int64
	FileName   int64
	StartLine  int64
}

Function is field 5.

type KeepFrames

type KeepFrames struct{ Value int64 }

KeepFrames is field 8

type Label

type Label struct {
	Key     int64
	Str     int64
	Num     int64
	NumUnit int64
}

Label is part of Sample.

type Line

type Line struct {
	FunctionID uint64
	Line       int64
}

Line is part of Location.

type Location

type Location struct {
	ID        uint64
	MappingID uint64
	Address   uint64
	Line      []Line
	IsFolded  bool
}

Location is field 4.

type LocationFast

type LocationFast struct {
	ID         uint64
	FunctionID []uint64
	Data       []byte
}

LocationFast is field 4. Unlike Location it only decodes the id and function ids of the location and stores its raw protobuf message. When encoding a LocationFast, the Data value gets written and changes to its other fields are ignored.

type Mapping

type Mapping struct {
	ID              uint64
	MemoryStart     uint64
	MemoryLimit     uint64
	FileOffset      uint64
	Filename        int64
	BuildID         int64
	HasFunctions    bool
	HasFilenames    bool
	HasLineNumbers  bool
	HasInlineFrames bool
}

Mapping is field 3.

type Period

type Period struct{ Value int64 }

Period is field 12

type PeriodType

type PeriodType struct {
	ValueType
}

PeriodType is field 11.

type Sample

type Sample struct {
	LocationID []uint64
	Value      []int64
	Label      []Label
}

Sample is field 2.

type SampleType

type SampleType struct {
	ValueType
}

SampleType is field 1.

type StringTable

type StringTable struct{ Value []byte }

StringTable is field 6.

type TimeNanos

type TimeNanos struct{ Value int64 }

TimeNanos is field 9

type ValueType

type ValueType struct {
	Type int64
	Unit int64
}

ValueType is part of SampleType and PeriodType.

Jump to

Keyboard shortcuts

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